 |
|
Code
Dim datamore As OdbcDataAdapter = New OdbcDataAdapter(" select unique eab14,eab02,ima06,ima01,eab15,eab17,max(eab05) as eab05" & _
" from eab_file, sfb_file, ima_file where eab02 = '" & str1 & "' and eab14 = '" & str2.ToString("dd-MM-yyyy") & "'" & _
" and sfb01=eab15 and sfb05=ima01 GROUP BY 1,2,3,4,5,6,7 ORDER BY 5 DESC", Conn1)
จาก SQL อันนี้นะครับ
ได้ค่าที่ผมต้องการแล้วครับ เป็นค่า ไม่ซ่ำกัน ประมาณ 5 บรรทัด
แต่ ผมต้องการค่า อีก 5 Item ครับ คือ eab06,eab07,eab08,eab09,eab10
แล้วผมก็เพิ่ม eab06,eab07,eab08,eab09,eab10
เป็น
Code
Dim datamore As OdbcDataAdapter = New OdbcDataAdapter(" select unique eab14,eab02,ima06,ima01,eab15,eab17,eab06,eab07,eab08,eab09,eab10,max(eab05) as eab05" & _
" from eab_file, sfb_file, ima_file where eab02 = '" & str1 & "' and eab14 = '" & str2.ToString("dd-MM-yyyy") & "'" & _
" and sfb01=eab15 and sfb05=ima01 GROUP BY 1,2,3,4,5,6,7 ORDER BY 5 DESC", Conn1)
ค่าที่ได้หลายบรรทัดเลยครับ ไม่เป็นค่า Unique เลยครับ เพราะว่ามันเอาค่า ที่ eab06,eab07,eab08,eab09,eab10 ออกมาหมดเลยครับ
ซึ่งค่าที่ผมต้องการ คือค่า eab06,eab07,eab08,eab09,eab10 ของ จาก SQL อันแรกอย่างเดียวครับ
Tag : .NET, Web (ASP.NET), VB.NET
|
ประวัติการแก้ไข 2013-10-25 11:36:53
|
 |
 |
 |
 |
Date :
2013-10-25 11:29:21 |
By :
zozazozy |
View :
815 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |