Re: Advanced query help

2010-09-27 Thread Johan De Meersman
Then you'll probably need to define it with a separate select before using it. I'm half-guessing here, really, but that sounds like it makes sense :-) On Mon, Sep 27, 2010 at 11:49 AM, Tompkins Neil < neil.tompk...@googlemail.com> wrote: > Hi, > > I did try defining it before the IF statement, bu

Re: Advanced query help

2010-09-27 Thread Tompkins Neil
Hi, I did try defining it before the IF statement, but still the same ? Cheers Neil On Mon, Sep 27, 2010 at 7:58 AM, Johan De Meersman wrote: > At a guess, because you use @team in an if statement before you actually > define it. > > > On Sun, Sep 26, 2010 at 12:35 AM, Tompkins Neil < > neil.to

Re: Advanced query help

2010-09-26 Thread Johan De Meersman
At a guess, because you use @team in an if statement before you actually define it. On Sun, Sep 26, 2010 at 12:35 AM, Tompkins Neil < neil.tompk...@googlemail.com> wrote: > Hi, > > I've the following query > > SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT > teams_id

Advanced query help

2010-09-25 Thread Tompkins Neil
Hi, I've the following query SELECT teams_id AS teams_id ,SUM(rating) AS total_team_rating FROM (SELECT teams_id ,players_id ,rating ,IF(@team <> teams_id, @row := 1, @row := @row + 1) AS rank ,@team := teams_id FROM ( SELECT players.teams_id ,players.players_id ,players_master.rating FROM player

Re: Advanced Query Help (My brain hurts!)

2003-06-29 Thread Bruce Feist
otherguy (Cameron Wilhelm ) wrote: Well, keep in mind that although SQL can do a lot in a single statement, it can't always do *everything* required for a business function in one statement. As I'm painfully aware of, but was hopeful about. Your hopes were sensible -- I believe that some SQL v

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread otherguy
On Saturday, June 28, 2003, at 07:15 PM, Bruce Feist wrote: otherguy wrote: On Saturday, June 28, 2003, at 03:43 PM, MyLists wrote: That gets me halfway there BF: Does it? No, I don't think it does, upon further consideration and testing... I thought it did b/c I read, and misinterprete

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread Bruce Feist
otherguy wrote: On Saturday, June 28, 2003, at 03:43 PM, MyLists wrote: That gets me halfway there BF: Does it? No, I don't think it does, upon further consideration and testing... I thought it did b/c I read, and misinterpreted the UNION documentation BF: In your original question

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread otherguy
On Saturday, June 28, 2003, at 03:43 PM, MyLists wrote: otherguy wrote: That gets me halfway there Does it? Yes, it does. No, I don't think it does, upon further consideration and testing... I thought it did b/c I read, and misinterpreted the UNION documentation In your original questio

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread MyLists
- Original Message - From: "Bruce Feist" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Saturday, June 28, 2003 6:28 PM Subject: Re: Advanced Query Help (My brain hurts!) > otherguy wrote: > > > That gets me halfway there &g

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread MyLists
PROTECTED]> Sent: Saturday, June 28, 2003 6:17 PM Subject: Re: Advanced Query Help (My brain hurts!) > Thank you! > > That gets me halfway there, and not to my surprise, it's not even that > hard! I should've known that it wouldn't be. > > So the other par

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread Bruce Feist
otherguy wrote: That gets me halfway there Does it? In your original question, you'd indicated that you only wanted zips where *both* criteria were met -- enough CIRGs and enough CILTs. By using a UNION, you'll be getting zips where *either* is met. Bruce Feist -- MySQL General Mailing Li

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread otherguy
need, then you can just "append" the two results by using UNION. Good Luck! Dennis - Original Message - From: "otherguy" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Cc: "Terry Vanstory" <[EMAIL PROTECTED]> Sent: F

Re: Advanced Query Help (My brain hurts!)

2003-06-28 Thread MyLists
ED]>; "MySQL List" <[EMAIL PROTECTED]>; "otherguy" <[EMAIL PROTECTED]> Cc: "Terry Vanstory" <[EMAIL PROTECTED]> Sent: Saturday, June 28, 2003 12:05 AM Subject: RE: Advanced Query Help (My brain hurts!) > would u have an example of how to use uni

RE: Advanced Query Help (My brain hurts!)

2003-06-27 Thread electroteque
Subject: Re: Advanced Query Help (My brain hurts!) How about a UNION statement? If the two queries are independently returning what you need, then you can just "append" the two results by using UNION. Good Luck! Dennis - Original Message - From: "otherguy" <[EMAIL

Re: Advanced Query Help (My brain hurts!)

2003-06-27 Thread MyLists
;[EMAIL PROTECTED]> Cc: "Terry Vanstory" <[EMAIL PROTECTED]> Sent: Friday, June 27, 2003 8:50 PM Subject: Advanced Query Help (My brain hurts!) > Hey guys, I'm about to dump a doozy on your collective knowledge and > goodwill, and hope for some help or some pointers. I&#x

Advanced Query Help (My brain hurts!)

2003-06-27 Thread otherguy
Hey guys, I'm about to dump a doozy on your collective knowledge and goodwill, and hope for some help or some pointers. I'm not great with advanced SQL, and I've gotten as far as my brain and the resources I've been using will allow me to get for the time being. I need help with two things: 1)