And y Or en Sentencia Select

1 095 vues

Publié le

0 commentaire
0 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Aucun téléchargement
Vues
Nombre de vues
1 095
Sur SlideShare
0
Issues des intégrations
0
Intégrations
28
Actions
Partages
0
Téléchargements
7
Commentaires
0
J’aime
0
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

And y Or en Sentencia Select

  1. 1. Ejemplo de And y Or Erik Sacre
  2. 2. And, Or, Not NULL NULL NULL NULL NULL FALSE NULL FALSE FALSE FALSE FALSE FALSE TRUE NULL NULL TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE a OR b a AND b b a NULL NULL TRUE FALSE FALSE TRUE NOT a a
  3. 3. Tabla para ejemplo CREATE TABLE and_or ( a char(1), b char(1), c char(1) ) a b c ------------- "1";"2";"3" "4";"5";"6" "7";"8";"9" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6"
  4. 4. Consultas ejemplo select * from and_or where (a ='1' and b = '2') or c = '3' "1";"2";"3" "1";"2";"3" select * from and_or where (a ='4' and b = '6') and c = '3' Ninguno a b c ------------- "1";"2";"3" "4";"5";"6" "7";"8";"9" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6"
  5. 5. Consultas ejemplo select * from and_or where a ='1' or b = '5' and c = '6' select * from and_or where (a ='1' or b = '5') and c = '6' "4";"5";"6" "4";"5";"6" "4";"5";"6" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6" a b c ------------- "1";"2";"3" "4";"5";"6" "7";"8";"9" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6"
  6. 6. Consultas ejemplo select * from and_or where (a not like '1' or b like '5') and c like '6' a b c ------------- "1";"2";"3" "4";"5";"6" "7";"8";"9" "4";"5";"6" "1";"2";"3" "4";"5";"6" "4";"5";"6" "4";"5";"6" "4";"5";"6" "4";"5";"6" "4";"5";"6"

×