|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Unique rows
Hi guys
Is there a way where I can SELECT * FROM TABLE where the value of the "entryRANK" field is unique? would it be something like this: "SELECT * FROM TABLE WHERE RANK is Unique" thanks Qutaibah |
|
#2
|
|||
|
|||
|
Hey,
You should use a distinct on the row that you want unique and also specify the other fields seperated by a comma, like this: select distinct(myName), myAge, mySex, myBlah from myTable where 1 get the idea? ![]() |
|
#3
|
|||
|
|||
|
it worked = )
thanks mytch
I tried it and worked just fine Qutaibah |
|
#4
|
|||
|
|||
|
mysql> select * from a;
+---+---+ | a | b | +---+---+ | a | a | | a | a | | a | c | | b | c | | b | b | +---+---+ 5 rows in set (0.00 sec) mysql> select distinct(a),b from a; +---+---+ | a | b | +---+---+ | a | a | | a | c | | b | c | | b | b | +---+---+ 4 rows in set (0.00 sec) WHYYY!!!!???? I WANT 2 ROWS!!! a IS DISTINCT!!! HEEEELP! ![]() |
|
#5
|
|||
|
|||
|
Table DATA +---+---+ | a | b | +---+---+ | 1 | a | | 1 | a | | 1 | c | | 2 | c | | 2 | b | +---+---+ mysql> select * FROM DATA GROUP BY a; +---+---+ | a | b | +---+---+ | 1 | a | | 2 | c | +---+---+ |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Unique rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|