- I want to select top 5 results/rows, in Microsoft SQL, I can use
Select Top 5 * from mytable where year="2002" order by lastname.
My questions are:
1) Select Top 5 ... is that SQL standard for other general SQL database? Specially for Interbase? I tried it in Interbase, it gave me error message. And I checked my SQL reference book, it is not in there.
2) If I want to select the results 10-15m how do I do it?
3) If "Select Top 5 " is not used in Interbase etc, how can select the top 5 rows in SQL then?
- use "Select CustNumber, Name from Mytable" SQL
later on, I can use
$name=$ROW->NAME; to get the name values.
but if i use "SELECT COUNT (CustNumber) from Mytable"
how can i get the count value? Should I change the SQL to "SELECT COUNT (CustNumber) AS totalnumber from Mytable"
and then later on
$count=$ROW->TOTALNUMBER; TO GET THE COUNT?
THANKS!