1
TableName
==============================
ID | A_ID | BLABLA | TIME
-----------------------------------------------
1 | n1 | X | Time
2 | n1 | X | Time
3 | n1 | X | Time
4 | n1 | Y | Time
5 | n1 | Z | Time
6 | n2 | Y | Time
7 | n2 | Y | Time
8 | n2 | Y | Time
9 | n3 | X | Time
10 | n4 | Z | Time
11 | n4 | Z | Time
13 | n5 | | Time
14 | n6 | X | Time
15 | n7 | | Time
16 | n8 | | Time
==================================
我要爲節目表查詢的結果,只使用MySQL查詢。
==============================
A_ID | BLABLA
-----------------------------------------------
n1 | X
n1 | Y
n1 | Z
n2 | Y
n3 | X
n4 | Z
n5 |
n6 | X
n7 |
n8 |
==================================
所以,如果你有'n1'其中有'BLABLA'值'X','Y',和'Z',你如何決定你想要哪些?最早的那個?最小的ID? – 2012-04-23 04:42:26