คืนค่าการตั้งค่าทั้งหมด
คุณแน่ใจว่าต้องการคืนค่าการตั้งค่าทั้งหมด ?
ลำดับตอนที่ #7 : SQL III - Using Subqueries
A
New Table
The
players Table
Using
2 SQL Statements
Subqueries
In SQL, you can write SQL statements within
another statement. When a statement is written within another, it's called a subquery. These allow you
to combine 2 or more SQL
statements into 1 so you can get more complex data. The example below
shows how to get "names of players with a higher score than Will".
Writing Subqueries
You can create subqueries by putting them in
parentheses, as shown below. Writing a subquery is generally the same as
writing an SQL statement, except that subqueries do not require a semicolon. Only one semicolon is
required at the very end of the SQL statement.
Order
of Execution
When an SQL statement includes subqueries, the
outer SQL statement will be performed after the subqueries, as shown in the
example below.
Making
the Data Easier to Read
AS
Using AS
By using AS, you can create temporary labels for column names and
tables.To do this, use the syntax: column_name AS
"New Name". This will display the column column_name as New Name.
ความคิดเห็น