|
 |
|
จะเลือกข้อมูล โดยที่แถวสุดท้ายแต่ละ id เป็นค่าว่างได้อย่างไรคับ |
|
 |
|
|
 |
 |
|
SELECT * FROM t1 WHERE f3=''
ลองดูนะครับ ผมลองแล้วเวิร์ค
|
 |
 |
 |
 |
Date :
2009-08-16 21:01:41 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณDownsTreamคับ
แต่ยังไม่ใช่คับเพราะข้อมูลที่ต้องการคือ
f1 f2 f3 f4
333 20090816 xxx 2
333 20090816 xxx 2
333 20090816 xxx 1
333 20090816 1
ถ้า SELECT * FROM t1 WHERE f3=''
จะได้ข้อมูล
f1 f2 f3 f4
111 20090816 3
333 20090816 1
|
 |
 |
 |
 |
Date :
2009-08-16 21:15:35 |
By :
neonai07 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT * FROM t1 WHERE f3='' OR f3='xxx'
แบบนี้ละครับ ถูกหรือป่าว
|
 |
 |
 |
 |
Date :
2009-08-16 21:31:21 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่ถูกคับ
ต้องการคือ แถวสุดท้ายของ f3 ต้องเป็นค่าว่างของแต่ละ f1
|
 |
 |
 |
 |
Date :
2009-08-16 21:39:18 |
By :
neonai07 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แวะมาให้กำลังใจเพ่ DownsTream สู้ๆครับ
|
 |
 |
 |
 |
Date :
2009-08-16 22:33:38 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งงง  
|
 |
 |
 |
 |
Date :
2009-08-16 22:49:19 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นอนก่อน ละครับ ไว้พรุ่งนี้ถ้ายังไม่มีคนตอบจะแวะมา ครับ
good night!!!!
|
 |
 |
 |
 |
Date :
2009-08-16 22:52:57 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
table t1
f1 f2 f3 f4
111 20090816 3
111 20090816 zzz 3
111 20090816 zzz 1
111 20090816 zzz 2
222 20090816 yyy 3
222 20090816 yyy 2
222 20090816 yyy 4
222 20090816 6
333 20090816 xxx 2
333 20090816 xxx 2
333 20090816 xxx 1
333 20090816 1
ผลลัพธ์ คือ
f1 f2 f3 f4
222 20090816 yyy 3
222 20090816 yyy 2
222 20090816 yyy 4
222 20090816 6
333 20090816 xxx 2
333 20090816 xxx 2
333 20090816 xxx 1
333 20090816 1
ช่ายหรือป่าวครับ
|
 |
 |
 |
 |
Date :
2009-08-17 08:37:30 |
By :
DownsStream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SELECT * FROM t1 order by f1,f2,f3,f4
ลองดูนะครับได้หรือป่าว
|
 |
 |
 |
 |
Date :
2009-08-17 13:56:37 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

EXPLAIN SELECT * FROM `t1` WHERE f1='333'

|
 |
 |
 |
 |
Date :
2009-08-18 16:44:50 |
By :
ebuzzz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|