sql select column query statement code example

Example 1: sql select syntax

select [all/distinct] <COL1>, <COL2>, <COL3>
from <TABLE_NAME>
[join <JOIN_CONDITION>]
[where <CONDITION>]
[group by <COLUMN_NAME>]
[having <SEARCH_CONDITION>]
[order by <SORT_SPECIFICATION>]


/*
Specifically for SQL -> Oracle

LEGEND: 
[...]   :   optional entries
<...>   :   your specific entry
*/

Example 2: sql select

Used to select data from a database, which is then returned in a results set.
Example 1: Selects all columns from all users.
SELECT * FROM users;
Example 2: Selects the first_name and surname columns
from all users.xx
SELECT first_name, surname FROM users;

Tags:

Sql Example