Sql select statement

This article is tagged with: Sql select statement and mysql

sql select statement

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

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>

SELECt sql

SELECT column1, column2, ...
FROM table_name;

sql select

SELECT * FROM table_name;

how select from db

SELECT columname FROM tablename

return columns from table sql

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS -- INFORMATION_SCHEMA is an ANSI-standard (American National Standard Institute) set of read-only views which provide information about all of the tables, views, columns, and procedures in a database
WHERE TABLE_NAME = N'Customers' -- "N" defines the subsequent string (the string after the N) as being in unicode

This article is tagged with: Sql select statement and mysql