I'm looking for something "a little bit faste开发者_JS百科r" than doing SELECT * FROM table_name and stepping through all the records...
SELECT COUNT(*) FROM table_name
Jaw dropping, eh? :)
Use the COUNT aggregate function:
SELECT COUNT(*) AS numRecords
FROM YOUR_TABLE
I defined the column alias "numRecords" to make it easier to isolate the value you want to retrieve.
Try SELECT COUNT(*) FROM table_name;
精彩评论