[EMAIL PROTECTED] wrote:


There may be other ways to get at the information you want. What is the purpose of your query?


Ok here are the details. I have a wish list/gift registry site (thewishzone.com). I have a table listing all the data on my users. I also have a table listing all the gifts my users want. Finally I have a table with gift giving events for the users. What I need to know is how many events and how many gifts each user has in the database so I can make certain changes to the content of the main user page on my site. Right now I just use 2 queries but I would like to do it in one just to reduce the code some what. I have other uses for similar queries but this is the main reason.

Chris W


2wsxdr5 <[EMAIL PROTECTED]> wrote on 01/13/2005 01:57:31 PM:

> I have these 2 queries.
>
> SELECT count(*) gifts
> FROM   gift g
> WHERE g.this and g.that
>
> SELECT count(*) events
> FROM   events e
> WHERE e.this and e.the other thing
>
> is there a way to put these into one query.....
>
> SELECT count(g.*) gifts, count(e.*)
> FROM gift g, event e
> WHERE . . . .
>
> so far nothing seems to be working
>
> --
> Chris W
>
> Gift Giving Made Easy
> Get the gifts you want & give the
> gifts they want this holiday season
> http://thewishzone.com
>
> "They that can give up essential liberty
> to obtain a little temporary safety
> deserve neither liberty nor safety."
> -- Benjamin Franklin, 1759 Historical Review of Pennsylvania
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>



-- Chris W

Gift Giving Made Easy
Get the gifts you want & give the gifts they want
http://thewishzone.com



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to