Crazy SELECT SUM ... JOIN ... GROUP problem

2003-03-03 Thread Dan Tappin
I have a complex JOIN statement that I can't seem to get to work. Here is my schema... I have a 'forsale' table with various colunms. Here is the query for the data I am interested in: SELECT id, clientid, price FROM forsale WHERE user_id = 152

Re: Crazy SELECT SUM ... JOIN ... GROUP problem

2003-03-03 Thread Bruce Feist
Dan Tappin wrote: I am sure I just have the wrong JOIN structure but I can't figure it out. Any help would be appreciated. Ah, if only it were that easy! The problem is that you're really trying to summarize at two ways at the same time, and SQL doesn't like to do that. On one hand you're

Re: Crazy SELECT SUM ... JOIN ... GROUP problem

2003-03-03 Thread Dan Tappin
To add to this I am using this data via PHP. I think it might be faster and easier to just create my summary via one select for the hits and then an inline select for the hits as I loop thru my PHP code to display the list of clients. I also could just create to separate selects grouped by

Crazy SELECT SUM ... JOIN ... GROUP problem

2003-03-01 Thread Dan Tappin
Oops... forgot the subject line... I have a complex JOIN statement that I can't seem to get to work. Here is my schema... I have a 'forsale' table with various colunms. Here is the query for the data I am interested in: SELECT id, clientid, price FROM forsale WHERE user_id = 152