If all you need is a count of the items why not issue
Select count(distinct threads) as ctr from messages
Jack ;-)=
----- Original Message -----
From: "Ed Lazor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 11:53 PM
Subject: how do you format this query?


> Hi =)  Could you help me with creating a proper query?  I have a table
that
> stores messages with a field for the message id, thread, and parent.  The
> goal is to create a query that gives me the total threads.  I read in a
> book and found the DISTINCT key allows me to run a query like this:
>
> select DISTINCT threads from messages;
>
> Then all I have to do is count the total number of rows returned.  I'm
> concerned this query will create unnecessary overhead as the number of
> messages in the archive exceeds tens of thousands.  Is there a query that
> will give me the information I'm looking for without creating the
overhead?
>
> -Ed
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to