Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Use SELECT Statement to Count the Number of Rows
How To Use SELECT Statement to Count the Number of Rows? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY
✍: FYIcenter.com
If you want to count the number of rows, you can use the COUNT(*) function in the SELECT clause. The following tutorial exercise shows you some good example:
mysql> SELECT COUNT(*) FROM fyi_links; +----------+ | COUNT(*) | +----------+ | 7 | +----------+ 1 row in set (0.00 sec) mysql> SELECT COUNT(*) FROM fyi_links WHERE url LIKE '%fyi%'; +----------+ | COUNT(*) | +----------+ | 3 | +----------+ 1 row in set (0.01 sec)
So there are 7 rows in total in table "fyi_links", and 3 rows that have 'fyi' as part of their url names.
2007-05-11, 5021👍, 0💬
Popular Posts:
What is AL.EXE and RESGEN.EXE? In the previous question you have seen how we can use resource files ...
Rachel opened her math book and found that the sum of the facing pages was 245. What pages did she o...
What are unadjusted function points and how is it calculated? Unadjusted function points = ILF + EIF...
How To Run "mysql" Commands from a Batch File? - MySQL FAQs - Command-Line End User Interface mysql ...
How To Increment Dates by 1? - MySQL FAQs - Introduction to SQL Date and Time Handling If you have a...