IN - defines a set of values. SELECT * FROM Persons WHERE name IN ('Ivan','Petr','Pavel'); BETWEEN defines a range of values. Unlike IN, BETWEEN is order sensitive, and the first value in the sentence must be the first in alphabetical or numeric order. SELECT * FROM Persons WHERE age BETWEEN 20 AND 25; LIKE is applicable only to fields of type CHAR or VARCHAR with which it is used to find substrings. As a condition, wildcards are used - special characters that can match something: _ stands for any single character. For example, 'b_t' will match the words 'bat' or 'bit', but will not match 'brat'. % replaces a sequence of any number of characters. For example '%p%t' will match 'put', 'posit', or 'opt', but not 'spite'. SELECT * FROM UNIVERSITY WHERE NAME LIKE '%o'; UNION keyword In SQL, the UNION keyword is used to combine the results of two SQL queries int...
Comments
Post a Comment