Hur gör man för att ändra en colomn i en tabell från notnull till null, med mysql kommandon?
Jag har rätt så mycket info i databasen så jag vill itne göra om allt frånbörjan. Jag har ingen gui klient (eller vad det nu heter), så jag måste använda kommandon direkt i mysql prompten.
Ändra från not null till null
3 svar · 185 visningar · startad av Rocket
Kolla http://www.mysql.com/doc/A/L/ALTER_TABLE.html
------------------
These are the cries of the carrots, the cries of the carrots! You see, Reverend Maynard, tomorrow is harvest day and to them it is the holocaust.
Tackar, mycket bra.
Saken är den att jag nu har nollor (0) där det inte finns någon info i databasen. Men jag vill att det inte ska vara något där det inte finns någon info. Är det null eller not null som tillåter att det itne är någon info i en "ruta"?
Vet inte om det går att stoppa in NULL på det viset... du kan ju prova UPDATE tabellen SET kolumnen = NULL WHERE kolumnen = 0, men jag tror att det kanske inte funkar.
------------------
These are the cries of the carrots, the cries of the carrots! You see, Reverend Maynard, tomorrow is harvest day and to them it is the holocaust.