|
Posted by Philippe Signoret on 04/24/06 08:50
If this is in the wrong group lemme know and I'll re-post it to the
correct one. I am using PHP and MySQL.
Suppose I have a table named "servicios" with 5 columns and 200 rows.
If I want to get the whole table sorted by column 3 (suppose the field
name is "nf") I use:
SELECT * FROM `servicios` ORDER BY `nf` ASC
This workd perfectly.
If I want to get just the first 10 rows with _no_ sorting I would use:
SELECT * FROM `servicios` LIMIT 10
This also works perfectly.
Now, if I want to get the first 10 rows, sorted by "nf", I use:
SELECT * FROM `servicios` ORDER BY `nf` ASC LIMIT 10
This does NOT work perfectly. The result I get is the first 10 rows of
whole table which has been sorted by "nf". What I want is just the
resulting first 10 rows to be sorted by "nf", not the whole table.
How can I do this?
Thanks,
Philippe
P.S. I am very new to MySQL, please forgive any unforgivable begginer
mistakes.
Navigation:
[Reply to this message]
|