datos verdadero o falso

[expired user #5814]'s profile image [expired user #5814] posted 13 years ago in General Permalink
hola tengo una tabla con una columna que me gustarĂ­a que al momento de seleccionarla me admitiera solo valores verdadero o falso( si o no ) como hago esto.
kalvaro's profile image kalvaro posted 13 years ago Permalink
Translated question: can I create a boolean column that will only accept TRUE or FALSE?

You cannot: MySQL does not have such feature (neither booleans nor check constraints). You can create an UNSIGNED TINYINT column and use 0 as false, 1 as true, but MySQL won't prevent you from inserting 2.

(No se puede ya que MySQL no tiene ni campos booleanos ni check constraints).

Please login to leave a reply, or register at first.