กระทู้เก่าบอร์ด อ.Yeadram
        
           1,801   2		  
          
					  
		    URL.หัวข้อ / 
		    URL
        
        All ใน Union Query      
    
      ธรรมดาผมทำ Union Query โดย Coppy จาก SQL Query มา 2 Query
จะมีตัวเชื่อม คือ Union แต่ผมเจอ Query อยู่อันหนึ่ง มี All ร่วมด้วย
UNION ALL SELECT........ อยากทราบว่า All มีความหมายว่าอย่างไรครับ
    
  จะมีตัวเชื่อม คือ Union แต่ผมเจอ Query อยู่อันหนึ่ง มี All ร่วมด้วย
UNION ALL SELECT........ อยากทราบว่า All มีความหมายว่าอย่างไรครับ
				2 Reply in this Topic. Dispaly 1  pages and you are on page number 1 
				
        
    2 @R11626    
        
    
      ขอบคุณ อ.PichaiTC มากครับ    
    
  
      Time: 0.1302s
    
      
		
By default, no duplicate records are returned when you use a UNION operation; however, you can include the ALL predicate to ensure that all records are returned. This also makes the query run faster.
แปลว่า โดยปกติ จะคืน record ที่ไม่ซ้ำมาให้ เมื่อใส่ All จะส่งค่าทุก record - ข้อดีที่แถมมาคือ จะเร็วกว่า(ในการคำนวณเพราะไม่ต้องตัด record ซ้า - แต่อาจจะช้าตอนส่งข้อมูลผ่าน network ถ้า record ซ้ำเยอะ)