Jump to content
php.lv forumi

Recommended Posts

Posted

mysql> select * from `table`;
+----+--------+
| id | name   |
+----+--------+
|  1 | aaaaaa |
|  2 | bbbbb  |
|  3 | ccccc  |
|  4 | ddddd  |
|  5 | eeeee  |
|  6 | wwwww  |
|  7 | ggggg  |
|  8 | hhhh   |
|  9 | uuuu   |
| 10 | iiiii  |
| 11 | gggg   |
| 12 | dddd   |
| 13 | sssss  |
| 14 | aaaaa  |
| 15 | jjjj   |
| 16 | uuuuu  |
| 17 | rrr    |
| 18 | mmmmm  |
+----+--------+

 

vajag izvadīt visu šo izvadīt html selectā, bet tā, lai piem.

ieraksts ar `name`='hhhh' būtu pirmais un pēc tam pārējie tikai.

Posted (edited)

Ja neesmu pārkarsis saulītē, tad

SELECT * FROM `table` WHERE `name` = 'hhhh' UNION SELECT * FROM `table`

jā UNION bija pareizā atbilde :)

Edited by kapec gan ne
Guest
This topic is now closed to further replies.
×
×
  • Create New...