RE: Using IF in a query to set a variable then sort on said variable

2009-10-26 Thread Jeff
To: Jeff Cc: mysql@lists.mysql.com Subject: Re: Using IF in a query to set a variable then sort on said variable 2009/10/26 Jeff : > Perhaps case is the way to go, I'll look into that this morning. > > Unfortunately there are three groupings. So my IF or CASE needs to check for >

Re: Using IF in a query to set a variable then sort on said variable

2009-10-26 Thread Jaime Crespo Rincón
2009/10/26 Jeff : > Perhaps case is the way to go, I'll look into that this morning. > > Unfortunately there are three groupings. So my IF or CASE needs to check for > example: > > if timezone = 3,5,6,7 then 1 > if timezone = 1,2,4 then 2 > if timezone = 8,9 then 3 Yes, Case function is the way t

RE: Using IF in a query to set a variable then sort on said variable

2009-10-26 Thread Jeff
ould be. I originally wanted to use mySQL as the part that did this processing as opposed to outputting the results then sorting an array. Jeff From: 卢钧轶 [mailto:cenal...@gmail.com] Sent: Sunday, October 25, 2009 1:19 AM To: Jeff Subject: Re: Using IF in a query to set a variable then sort on sai

Re: Using IF in a query to set a variable then sort on said variable

2009-10-25 Thread Jaime Crespo Rincón
2009/10/23 Jeff : > I currently have a query like so: > > SELECT p.fldId, p.fldFName, p.fldLName, p.fldEmail, p.fldPhone, p.resellerId, > d.timezoneId, d.bestTime, d.lastDate, d.lastTime, d.lastConnected FROM > tblProspects as p LEFT JOIN tblProspectsDetails as d ON d.prospectId = > p.fldId WHER

RE: using if in select statement

2005-04-29 Thread mathias fatene
#x27;mysql@lists.mysql.com ' Subject: re: using if in select statement -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something th

re: using if in select statement

2005-04-28 Thread James Black
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 My boss and I were playing with using select statements, and we can actually execute subqueries as an option if the result is true or false. Is this expected behavior, or is it something that may be fixed in a revision, before I begin to depend on it

Re: Using IF

2004-06-11 Thread SGreen
You can do this as a UNION statement or the long way. This is a UNION example: select rac.name as race, ch.* from characters as ch inner join races as rac on rac.raceID = ch.raceID inner join entityLocation el on el.entityID = ch.characterID and el.visibility <=60 and el.e

Re: Using IF

2004-06-11 Thread Johan Hook
Hi Keith, I think your problem comes down to the fact that IF() is a function that must return one value, when you put in your '*' you might be specifying more then one value to return. /Johan Keith wrote: g'day, Am having a bit of a problem with using IF. This is the error message I get: - SEL

Re: Using IF clause

2004-05-31 Thread Michael Stassen
ColdFusion Lists wrote: Hi my table have an field when users can enter any chars If users dont send any content for that field(phone), mysql store "( ) - " without quotes in that What im looking for: Display IF phone field is ( ) - NOT ENTER Otherwise display the phone of user.