Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Impostazione DB MySql

  1. #1
    Utente di HTML.it L'avatar di ubbicom
    Registrato dal
    Mar 2004
    Messaggi
    1,407

    Impostazione DB MySql

    Scusate in un DB MySql è possibile prevedere un campo IDutente (diverso dall'ID contatore) in cui la proprietà sia "Duplicati non ammessi".
    Se si come si imposta?

    Grazie

  2. #2
    Utente di HTML.it L'avatar di Luis33
    Registrato dal
    May 2003
    Messaggi
    975
    Dovresti usare il limitatore UNIQUE:

    In MySQL, a UNIQUE index is one in which all values in the index must be distinct. An error occurs if you try to add a new row with a key that matches an existing row. The exception to this is that if a column in the index is allowed to contain NULL values, it can contain multiple NULL values. This exception does not apply to BDB tables, which allow only a single NULL.
    http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html

    ... Sono graditi codes, esempi pratici, suggerimenti, consigli e critiche...
    "Ai posteri l'ardua sentenza..."
    Tante grazie
    Saluti
    Luis 33

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.