You are here: Home >Posts Tagged ‘DISTINCT

SQL SELECT DISTINCT Statement

This chapter will explain the SELECT DISTINCT statement.  เป็นการหาค่าที่ไม่ซ้ำของ SQL Command Query หรือ SELECT DISTINCT นั้นเอง The SQL SELECT DISTINCT Statement In a table, some of the columns may contain duplicate values. This is not a problem, however, sometimes you will want to list only the different (distinct) values in a table. The DISTINCT keyword [...]

Tags: , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Why UNION ALL is faster than UNION?

UNION and UNION ALL เป็นคำสั่งของ SQL Query สำหรับการรวมดาต้าจาก Table ต่างกันตั้งแต่สอง Table ขึั้นไป ซึ่งเป็นการรวมกันโดยจะต้องมีฟิลล์หรือคอลัมน์ที่เท่ากัน เป็นการรวมกันในแนวนอนหรือ Horizontally เรียงตางรำดับจากบนลงล่าง UNION จะนำข้อมูลมารวมกันแล้วเอาค่าที่ไม่ซ้ำกัน(Distinct) ในสองตารางมาแสดงผล UNION ALL จะนำข้อมูลมารวมกันโดยไม่สนใจค่าที่ซ้ำกันหรือ duplicates กัน

Tags: , , , , , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS