-
Notifications
You must be signed in to change notification settings - Fork 0
/
selsect-where-part-1-17.psql
40 lines (33 loc) · 1.06 KB
/
selsect-where-part-1-17.psql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* SELECT and WHERE are the most
* fundimental SQL statements and you will use them often.
* The WHERE statement allows uus to specify conditons on columns or rows to be returned.
The WHERE clause appears immediately after the FROM clause of the SELECT statement as seen below.
The conditions are used to filter the rows returned from the SELECT statement.
PostgreSQL provides a variety of standard operators to construct the conditions.
* Example of syntax:
- SELECT column1, column2
FROM table
WkERE condition;
Comparospm Operators
|=| Equal
---------------------
|>| Greater Than
---------------------
|<| Less Than
---------------------
|>=| Greather than or equal to
------------------------------
|=>| Lesser than or equal to
------------------------------
|<> or !=| Not equal to
-------------------------
And rhen we have Logical Operators.
Allow us to combine multiple comparison operators
- AND
- OR
- NOT
*/
-- SELECT title FROM film;
SELECT title FROM film WHERE title = 'Alone Trip';
SELECT id, title from film where id = 21;