SQL SELECT
Sat Mar 31, 2018 11:00 pm
SQL SELECT
The most common use of SQL is to read data from the database. This is done through the SELECT command, which returns records in a result array. This command can select one or more columns in a table.
Basic command
The basic use of this command is as follows:
SELECT field_name FROM table_name FROM table_name
This SQL query will select (SELECT) the field "field_name" from (FROM) the array called "table_name".
Example
Imagine a database called "client" that contains information about a company's customers.
"Customer" table:
login first name name city
1 Pierre Dupond Paris
2 Sabrina Durand Nantes
3 Julian Martin Lyon
4 David Bernard Marseilles
5 Married Leroy Grenoble
If you want to have a list of all the cities of the customers, it is enough to carry out the query SQL below:
The most common use of SQL is to read data from the database. This is done through the SELECT command, which returns records in a result array. This command can select one or more columns in a table.
Basic command
The basic use of this command is as follows:
SELECT field_name FROM table_name FROM table_name
This SQL query will select (SELECT) the field "field_name" from (FROM) the array called "table_name".
Example
Imagine a database called "client" that contains information about a company's customers.
"Customer" table:
login first name name city
1 Pierre Dupond Paris
2 Sabrina Durand Nantes
3 Julian Martin Lyon
4 David Bernard Marseilles
5 Married Leroy Grenoble
If you want to have a list of all the cities of the customers, it is enough to carry out the query SQL below:
Permissions in this forum:
You cannot reply to topics in this forum