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

ค่าเริ่มต้น

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

    ลำดับตอนที่ #4 : SQL II - Process Search Results

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

    Processing Results


     

    Omitting Duplicate Data


     

    DISTINCT

    By using DISTINCT you can exclude duplicate rows of data from your search results. You can specify the name of a column to get only unique rows, omitting duplicates. To do this, use the following syntax: DISTINCT( column_name )


    Using DISTINCT

    As shown below, you can use DISTINCT in a SELECT statement to omit duplicate rows. In the example, the statement gets rows of the name column from the purchases table with duplicates excluded. 



    Using Arithmetic Operators


     

    Arithmetic Operators

    It's possible to do calculations in SQL with the these arithmetic operators: + (addition), - (subtraction), / (division), and * (multiplication). As shown below, using these operators, you can perform calculations on the rows of a specified column.


    Using Arithmetic Operators

    In order to get the price with tax, we will multiply the price column by 1.09 (for a 9% sales tax rate). Similar to using DISTINCT, arithmetic operators can be used after the SELECT keyword in SQL statements to get the resulting values of a calculation.


     

     




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

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

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

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

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

    ความคิดเห็น

    ×