Re: How to use 'if' in select [solved]

2005-11-29 Thread Gobi
Thanks for everyone's input. Essentially, I summed up all the NEGs and non-NEGs in a view and then use the 'if' logic to filter out the numbers. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: How to use 'if' in select

2005-11-28 Thread Gobi
[EMAIL PROTECTED] wrote: Wouldn't it be just as simple to count all 'neg', 'pos', and 'ind' values for both columns? By the way, is there some other column you are grouping by or is it always going to apply to entire tables of information? I know this is not what you wanted. However, what you

Re: How to use 'if' in select

2005-11-28 Thread Gobi
[EMAIL PROTECTED] wrote: Wouldn't it be just as simple to count all 'neg', 'pos', and 'ind' values for both columns? By the way, is there some other column you are grouping by or is it always going to apply to entire tables of information? I know this is not what you wanted. However, what you

Re: How to use 'if' in select

2005-11-28 Thread SGreen
Gobi <[EMAIL PROTECTED]> wrote on 11/28/2005 10:34:37 AM: > Felix Geerinckx wrote: > > >On 28/11/2005, Gobi wrote: > > > > > > > >>I need to write a select clause based on the following conditions: > >> > >>If all rows of status1 == "Neg" > >>count all "Neg" rows in status1 > >>else > >>check if

Re: How to use 'if' in select

2005-11-28 Thread Gobi
Felix Geerinckx wrote: On 28/11/2005, Gobi wrote: I need to write a select clause based on the following conditions: If all rows of status1 == "Neg" count all "Neg" rows in status1 else check if all rows of status2 == "Neg" count all "Neg" rows in status2 and status1 endif endif No

Re: How to use 'if' in select

2005-11-28 Thread Felix Geerinckx
On 28/11/2005, Gobi wrote: > I need to write a select clause based on the following conditions: > > If all rows of status1 == "Neg" > count all "Neg" rows in status1 > else > check if all rows of status2 == "Neg" > count all "Neg" rows in status2 and status1 > endif > endif Not sure if I under

How to use 'if' in select

2005-11-28 Thread Gobi
I have not used an 'if' clause in select before but I think I may have a scenario which calls for it. I have a table with the following sample data: idx status1 status2 1"Neg""Neg" 2"Pos""Neg" 3"Neg"NULL 4"Ind""Neg" I need to write a select clause based on the