select in sql code example

Example 1: sql update select

UPDATE
    Table_A
SET
    Table_A.col1 = Table_B.col1,
    Table_A.col2 = Table_B.col2
FROM
    Some_Table AS Table_A
    INNER JOIN Other_Table AS Table_B
        ON Table_A.id = Table_B.id
WHERE
    Table_A.col3 = 'cool'

Example 2: 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 3: sql select

SELECT * FROM TABLE_NAME;

Example 4: how select from db

SELECT columname FROM tablename

Example 5: select query in sql

SELECT column_name FROM table_name;

Example 6: select in select sql

SELECT column1 = (SELECT column-name FROM table-name WHERE condition),       column-names  FROM table-name WEHRE condition

Tags:

Css Example