Share
Showing posts with label AND. Show all posts
Showing posts with label AND. Show all posts


  • Select a row from a specific column by giving a condition-
    SELECT name, address FROM customers WHERE id=54
  • Select all the row accept a specific row from a column-
    SELECT name, address FROM customers WHERE id !=54
  • Select rows by implementing different condition-
    SELECT name, address FROM customers WHERE id <54
  • Select  rows between two specific rows by using statement BETWEEN-
    SELECT name, state FROM customers WHERE id BETWEEN 20 AND 30
      

  • 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'