SQL Basics
Last updated
Was this helpful?
Last updated
Was this helpful?
Select name, price From products Where id=1;
This grabs the item name and price (columns) from the product table where the id(row) is 1.
You can also select constants: Select 22, 'string', 0x12;
This combines multiple sql queries (requests).
<Select statement> Union <Select statement>;
Use Distinct to filter out duplicate entries: Select DISTINCT <unique item> <statement>;
When using Union it automatically implies Distinct. You can stop that by using ALL:
<Select statement> Union ALL <Select statement>;
Ether 2 dashes followed by a space or a hash
--
#