Sql select syntax

This article is tagged with: Sql select syntax and mysql

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
*/</sort_specification></search_condition></column_name></condition></join_condition></table_name></col3></col2></col1>

sql select statement

SELECT * FROM table_name;
--or
SELECT column1, column2
FROM table_name;

how select from db

SELECT columname FROM tablename

This article is tagged with: Sql select syntax and mysql