Re: counting rows

2004-10-19 Thread Eric Bergen
When you get the results of the query use mysql_num_rows(res) to get the number of groups. Or if you only want to return the number of groups in a query use something like. select count(distinct field) from table; -Eric On Wed, 20 Oct 2004 03:03:47 +0200, Marco <[EMAIL PROTECTED]> wrote: > I wou

counting rows

2004-10-19 Thread Marco
I would like to count all of the resulting rows of my query. But my query contains a "group by", so select count(*) from table group by field will select an individual group count for each group. Instead, I would like to count the number of groups. Thanks, Marco -- MySQL General Mailing List For

Re: counting rows in all tables

2004-03-25 Thread Don Read
On 25-Mar-2004 [EMAIL PROTECTED] wrote: > Not using perl or php I came up with: > > mysqlshow -u user --status db_name | awk -F"|" '{print $2,$5}' | grep > -i pattern > > Is there a query to do the same thing? > > SHOW TABLE STATUS -- Don Read [EMAIL PRO

counting rows in all tables

2004-03-24 Thread doug
Not using perl or php I came up with: mysqlshow -u user --status db_name | awk -F"|" '{print $2,$5}' | grep -i pattern Is there a query to do the same thing? _ Douglas Denault [EMAIL PROTECTED] Voice: 301-469-8766 Fax: 301-469-0601 -- MySQL General Mailing List For list archives: http:/

Re: Counting rows when order is ambiguous

2004-02-26 Thread Sasha Pachev
Philip Mak wrote: Say I have this query: SELECT * FROM topics ORDER BY lastPostTime DESC; How would I modify it to answer the question "How many rows would be returned before the row that has topics.id = $x"? I was thinking of something like this: $xPostTime = SELECT lastPostTime FROM topics WHER

Re: Counting rows when order is ambiguous

2004-02-26 Thread Philip Mak
On Thu, Feb 26, 2004 at 09:50:39AM -0700, Sasha Pachev wrote: > If I understood the problem correctly, the answer to it is actually > undefined. If you order by lastPostTime, the records with the same > lastPostTime value can be returned in any order. > > I guess to accomplish your goal you could

Re: Counting rows when order is ambiguous

2004-02-26 Thread Sasha Pachev
Philip Mak wrote: On Thu, Feb 26, 2004 at 09:50:39AM -0700, Sasha Pachev wrote: If I understood the problem correctly, the answer to it is actually undefined. If you order by lastPostTime, the records with the same lastPostTime value can be returned in any order. I guess to accomplish your goal yo

Re: Counting rows when order is ambiguous

2004-02-26 Thread Philip Mak
On Thu, Feb 26, 2004 at 10:49:08AM -0700, Sasha Pachev wrote: > >SELECT COUNT(*) > >FROM topics > >WHERE lastPostTime > $postTime > >OR (lastPostTime = $postTime AND id > $id); > > Can you just add id > $id to the where clause? No, that won't work because id is only used to disambiguate the order

Re: Counting rows when order is ambiguous

2004-02-26 Thread Sasha Pachev
Philip Mak wrote: On Thu, Feb 26, 2004 at 10:49:08AM -0700, Sasha Pachev wrote: SELECT COUNT(*) FROM topics WHERE lastPostTime > $postTime OR (lastPostTime = $postTime AND id > $id); Can you just add id > $id to the where clause? No, that won't work because id is only used to disambiguate the

Counting rows when order is ambiguous

2004-02-25 Thread Philip Mak
Say I have this query: SELECT * FROM topics ORDER BY lastPostTime DESC; How would I modify it to answer the question "How many rows would be returned before the row that has topics.id = $x"? I was thinking of something like this: $xPostTime = SELECT lastPostTime FROM topics WHERE id = $x; SELE

Re: Counting rows with same information

2003-08-17 Thread Doruk Fisek
Hi, Sun, 17 Aug 2003 20:08:43 +0300 tarihinde Ville Mattila <[EMAIL PROTECTED]> soyle yazdi: VM> I've already tried this VM> SELECT DISTINCT mh.*, COUNT(mh2.id) AS albumsofartist FROM cd.mh, VM> cd.mh2 WHERE mh.artist= mh2.artist GROUP BY mh2.artist VM> But it dosen't give correct results. Try

Counting rows with same information

2003-08-17 Thread Ville Mattila
Hi there, I have a table containing my CD collection information, the simplified structure is following: id artist album 1 A.R.T The best of A.R.T 2 ATB Big Hits Collection 3 A.R.T My Artistic Life 4 A.R.T You are the only one How can I build up a query that will contain all

Re: [mysql] Counting rows

2003-02-11 Thread Ahmed S K Anis
show table status: check out the columns names you will get as idea as to how info it gives. >>> olinux <[EMAIL PROTECTED]> Wednesday, February 12, 2003 12:21:16 PM >>> SELECT count(*) FROM table WHERE whatever olinux --- Tim Johnson <[EMAIL PROTECTED]> wrote: > Hello All: > Let's sup

Re: [mysql] Counting rows

2003-02-11 Thread olinux
SELECT count(*) FROM table WHERE whatever olinux --- Tim Johnson <[EMAIL PROTECTED]> wrote: > Hello All: > Let's suppose I want to count the rows in set > for a match > to a value in a column. I don't need to read the > selection > set, I just need to know the number of matches. > > What is

[mysql] Counting rows

2003-02-10 Thread Tim Johnson
Hello All: Let's suppose I want to count the rows in set for a match to a value in a column. I don't need to read the selection set, I just need to know the number of matches. What is the quickest, most efficient way to do this in mysql? TIA -- Tim Johnson <[EMAIL PROTECTED]> http://www

Re: Re[2]: counting rows ...

2002-06-19 Thread Michael Widenius
Hi! > "Sinisa" == Sinisa Milivojevic <[EMAIL PROTECTED]> writes: Sinisa> Victoria Reznichenko writes: >> Hi! >> SM> Are you using our binaries ?? >> >> Yes. >> SM> If yes, send me a dump of the table and exact queries ... >> >> It's a strange... >> >> Seems, troubles occur when there i

Re: Re[2]: counting rows ...

2002-06-14 Thread Sinisa Milivojevic
Victoria Reznichenko writes: > Hi! > > SM> Are you using our binaries ?? > > Yes. > > SM> If yes, send me a dump of the table and exact queries ... > > It's a strange... > > Seems, troubles occur when there is a fulltext index and the text > column is NOT NULL. Besides, when I do CREATE .. SE