vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| What's a quick query to determine how many records a given table contains? I don't think that a SELECT query is appropriate, as I don't intend on doing anything with the data selected. Note that I'm interfacing with MySQL via php, if that matters. Thanks. Dotan Cohen http://what-is-what.com/what_is/copyleft.html http://lyricslist.com/ |
| |||
| Use SELECT in with count(*) SELECT count(*) from YOUR_TABLE Mikhail Berman -----Original Message----- From: Dotan Cohen [mailto:dotancohen@gmail.com] Sent: Wednesday, December 06, 2006 3:37 PM To: MySQL General Subject: How many records in table? What's a quick query to determine how many records a given table contains? I don't think that a SELECT query is appropriate, as I don't intend on doing anything with the data selected. Note that I'm interfacing with MySQL via php, if that matters. Thanks. Dotan Cohen http://what-is-what.com/what_is/copyleft.html http://lyricslist.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=mberman@ivesinc.com |
| |||
| On 06/12/06, Mikhail Berman <mberman@ivesinc.com> wrote: > Use SELECT in with count(*) > > SELECT count(*) from YOUR_TABLE > > > Mikhail Berman > Thanks, Mikhail. Will do. Dotan Cohen http://what-is-what.com/what_is/xss.html http://english-lyrics.com/ |
| ||||
| On 12/6/06, Mikhail Berman <mberman@ivesinc.com> wrote: > > -----Original Message----- > > > From: Dotan Cohen [mailto:dotancohen@gmail.com] > > Sent: Wednesday, December 06, 2006 3:37 PM > > To: MySQL General > > Subject: How many records in table? > > > > What's a quick query to determine how many records a given table > > contains? > > > SELECT count(*) from YOUR_TABLE > > This will return instantly for MyISAM tables but will have to count rows on InnoDB. -- -jp Chuck Norris frequently donates blood to the Red Cross. Just never his own. |