Prochain SlideShare
Chargement dans…5
×

# And y Or en Sentencia Select

1 130 vues

Publié le

0 commentaire
0 j’aime
Statistiques
Remarques
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Soyez le premier à commenter

• Soyez le premier à aimer ceci

Aucun téléchargement
Vues
Nombre de vues
1 130
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 ------------- &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;7&quot;;&quot;8&quot;;&quot;9&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot;
4. 4. Consultas ejemplo select * from and_or where (a ='1' and b = '2') or c = '3' &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; select * from and_or where (a ='4' and b = '6') and c = '3' Ninguno a b c ------------- &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;7&quot;;&quot;8&quot;;&quot;9&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot;
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' &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; a b c ------------- &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;7&quot;;&quot;8&quot;;&quot;9&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot;
6. 6. Consultas ejemplo select * from and_or where (a not like '1' or b like '5') and c like '6' a b c ------------- &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;7&quot;;&quot;8&quot;;&quot;9&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;1&quot;;&quot;2&quot;;&quot;3&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot; &quot;4&quot;;&quot;5&quot;;&quot;6&quot;