SQL SELECT Statement
SQL Tutorial » SQL SELECT Statement
What is SELECT * from in SQL?
SQL SELECT statement is used to select any data from a database.
The data returned (displayed) is stored in a result table, called the result-set.
Syntax:
FROM table_name;
column_name1, column_name2, ... are the field names of the table_name you want to select data from.
To select all the fields available in the table_name, you have to use the following syntax:
Let's look at the "Order_details" table: We will have seven columns as: "id", "first_name", "last_name", "country", "city", "product_id"and "quantity":
ID | First Name | Last Name | Country | City | Product ID | Quantity |
---|---|---|---|---|---|---|
1 | Clark | Kent | USA | Miami | 24 | 11 |
2 | Pire | Joveau | France | Paris | 56 | 32 |
3 | Nicky | Anderson | Boston | 67 | 9 | |
4 | Pepe | Martínez | Spain | Madrid | 112 | 26 |
5 | Peter | Parker | SUA | Los Angeles | 19 | 41 |
How do I SELECT specific rows in SQL? Example
Let's look at the "Order_details" table: We will have seven columns as: "id", "first_name", "last_name", "country", "city", "product_id"and "quantity":
The following SQL statement selects the "CustomerName" and "City" columns from the "Customers" table:
Display out: Number of Records: 5
ID | First Name | Last Name |
---|---|---|
1 | Clark | Kent |
2 | Pire | Joveau |
3 | Nicky | Anderson |
4 | Pepe | Martínez |
5 | Peter | Parker |
Related subjects:
SQL order by
SQL where clause
PHP select / view data
Conect to MySQLi
SQL insert into table
Tags: sql select: from multiple tables, as, synrax, distinct, count, group by, sort, top, like, into
What is SELECT * from in SQL?
What is a SELECT list SQL?
How do I SELECT specific rows in SQL?
How do you query in SQL?
SQL SELECT statement all columns from table
The following SQL SELECT statement all the columns from the "Order_details" table:
ID | First Name | Last Name | Country | City | Product ID | Quantity |
---|---|---|---|---|---|---|
1 | Clark | Kent | USA | Miami | 24 | 11 |
2 | Pire | Joveau | France | Paris | 56 | 32 |
3 | Nicky | Anderson | Boston | 67 | 9 | |
4 | Pepe | Martínez | Spain | Madrid | 112 | 26 |
5 | Peter | Parker | SUA | Los Angeles | 19 | 41 |
How do you SELECT multiple tables in a query?
How do you SELECT multiple tables in a query?
How can I get data from three tables in a single query?
We have three database as: country, products, customer
FROM country
INNER JOIN products ON product.country_id = country.id
INNER JOIN customer ON customer.product_id = product.id;
sql select: from multiple tables, as, synrax, distinct, count, group by, sort, top, like, into
What is SELECT * from in SQL?
What is a SELECT list SQL?
How do I SELECT specific rows in SQL?
How do you query in SQL?
SQL SELECT Statement - sql tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.