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
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
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
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:/
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
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
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
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
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
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
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
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
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
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
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
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
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
17 matches
Mail list logo