ตั้งค่าการอ่าน

ค่าเริ่มต้น

  • เลื่อนอัตโนมัติ
    SQL

    ลำดับตอนที่ #7 : SQL III - Using Subqueries

    • เนื้อหาตอนนี้เปิดให้อ่าน
    • 27
      0
      4 ม.ค. 62

    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.


     




    ติดตามเรื่องนี้
    เก็บเข้าคอลเล็กชัน

    นิยายที่ผู้อ่านนิยมอ่านต่อ ดูทั้งหมด

    loading
    กำลังโหลด...

    อีบุ๊ก ดูทั้งหมด

    loading
    กำลังโหลด...

    ความคิดเห็น

    ×