Share
Showing posts with label OR. Show all posts
Showing posts with label OR. Show all posts
  • For multiple conditions the use of statement AND-
    SELECT name, state, city FROM customers WHERE state='CA' AND city='Hollywood'
  • For multiple conditions the use of statement OR-
    SELECT name, state, city FROM customers WHERE state='CA' OR city='Hollywood'
  • Use statement AND, OR in the same query-
    SELECT name, state, city FROM customers WHERE id=2 OR id=5 AND state='CA'
  • Make query true for all conditions in the same order-
    SELECT name, state, city FROM customers WHERE (id=2 OR id=5) AND state='CA'