Re: Group By and IF statement

2007-11-08 Thread Enrique Sanchez Vela
--- mysqlman <[EMAIL PROTECTED]> wrote: > > I am attempting to get a simple query working: > > select *,MAX(a.teaching_date) as max, > MIN(a.teaching_date) as min from > teaching a, topic_cat b where a.teaching_topic = > b.topic_id or > a.teaching_topic = 999 group by a.teaching_topic > order b

Re: Group By and IF statement

2007-11-08 Thread yaya sirima
rder by a.teaching_date > DESC > > This all works, except I don't want to 'group by a.teaching_topic' if > a.teaching_topic = 999. > > Anyone know how to do this? Thank you. > -- > View this message in context: > http://www.nabble.com/Group-By-and-IF-st

Group By and IF statement

2007-11-07 Thread mysqlman
want to 'group by a.teaching_topic' if a.teaching_topic = 999. Anyone know how to do this? Thank you. -- View this message in context: http://www.nabble.com/Group-By-and-IF-statement-tf4768518.html#a13639835 Sent from the MySQL - General mailing list archive at Nabble.com. --

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread Peter Brawley
Shawn, Madderla, >Don't you need to DECLARE the variable "mvalidate" before you can use it? It's declared as OUT mvalidate varchar(10). PB - [EMAIL PROTECTED] wrote: madderla sreedhar <[EMAIL PROTECTED]> wrote on 05/02/2005 03:10:07 AM: Can u please execute the following

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread Peter Brawley
Madderla, 1. Var assignments need SET, ie SET mvariable = ... 2. Missing semicolon after 'TRUE' PB - madderla sreedhar wrote: Can u please execute the following procedure in MySql and tell me where I had gone wrong because on my system the same code is giving error near line " := 'TRUE' " CR

Re: NEED HELP IN IF STATEMENT

2005-05-02 Thread SGreen
madderla sreedhar <[EMAIL PROTECTED]> wrote on 05/02/2005 03:10:07 AM: > Can u please execute the following procedure in MySql > and tell me where I had gone wrong because on my > system the same code is giving error near line > " := 'TRUE' " > > CREATE PROCEDURE cart_items_validate > (IN mcus

NEED HELP IN IF STATEMENT

2005-05-02 Thread madderla sreedhar
Can u please execute the following procedure in MySql and tell me where I had gone wrong because on my system the same code is giving error near line " := 'TRUE' " CREATE PROCEDURE cart_items_validate (IN mcustid INT ,IN mprodid varchar(10), OUT mvalidate varchar(10)) BEGIN DECLARE rowexists

COUNT(DISTINCT R1,R2) within an IF statement?

2005-04-17 Thread Dan Bolser
Hi, I have a query which looks like this... SELECT BLEAH, COUNT(DISTINCT R1,R2) FROM T1 WHERE FK = 1 GROUP BY BLEAH ; Lets say that over 10 rows where FK = 1 it counts 5 distinct R1-R2 pairs in a single 'BLEAH' group BLEAH = 'Y'. Now I want to search the table for all FK's with the

FW: if statement help

2005-03-30 Thread Tom Crimmins
Just forwarding this to the list. On Wednesday, March 30, 2005 10:43, Christopher Vaughan wrote: > Tom Crimmins on Wednesday, March 30, 2005 at 11:31 AM -0500 wrote: >> Look at the functions HOUR(time), MINUTE(time), SECOND(time). These >> will give you interger output for each part of the time

Re: if statement help

2005-03-30 Thread Alec . Cawley
m. Then I want to take that data and sum it. > I wrote an if statement to parse through this table but I can't get > it to work. I am not sure If my syntax is > wrong because I can't find anything to check against it. > > Here is the syntax: > > IF > (S

Re: if statement help

2005-03-30 Thread Dan Bolser
33:33:33 >It stands for hhh:mm:ss >I want to break each part of the data into different parts based on the ':' to >separate them. Then I want to take that data and sum it. I wrote an if >statement to parse through this table but I can't get it to work. I am not >

RE: if statement help

2005-03-30 Thread Tom Crimmins
On Wednesday, March 30, 2005 10:24, Christopher Vaughan wrote: > Tom Crimmins on Wednesday, March 30, 2005 at 11:10 AM -0500 wrote: >> If you convert it to a time field you can use mysql built-in >> functions to do what you want. You are limited to the range >> -838:59:59 to 838:59:59 though. >

RE: if statement help

2005-03-30 Thread Tom Crimmins
o 838:59:59 though. http://dev.mysql.com/doc/mysql/en/time.html http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html > I want to break each part of the data into different parts based on > the ':' to separate them. Then I want to take that data and sum it. > I wrote a

if statement help

2005-03-30 Thread Christopher Vaughan
I have data in a table listed as 44:22:22 333:33:33 It stands for hhh:mm:ss I want to break each part of the data into different parts based on the ':' to separate them. Then I want to take that data and sum it. I wrote an if statement to parse through this table but I can't

Re: If statement in a where query....

2004-12-01 Thread yoge
if( length(last_renewal_date) < 1, signup_date between '2004-11-01' and '2004-11-30' ) order by last_renewal_date Obviously the syntax is wrong here, but is there a way to accomplish this logic using an

Re: If statement in a where query....

2004-12-01 Thread Rhino
- Original Message - From: "Mike Morton" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 01, 2004 2:47 PM Subject: If statement in a where query > I am trying to find a list of people based on renewal dates, the logic of > th

Re: If statement in a where query....

2004-12-01 Thread SGreen
and '2004-11-30' > ) > order by last_renewal_date > > Obviously the syntax is wrong here, but is there a way to accomplish this > logic using an if statement in the where statement? > > TIA! > > -- > Cheers > > Mike Morton > >

If statement in a where query....

2004-12-01 Thread Mike Morton
rong here, but is there a way to accomplish this logic using an if statement in the where statement? TIA! -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * "Indeed,

Re: Nested IF statement in 3.23.57

2004-03-25 Thread Paul DuBois
At 18:44 -0500 3/25/04, David Perron wrote: Are nested IF statements valid? Doesn't say anything here: http://www.mysql.com/doc/en/Control_flow_functions.html Yes, you can nest them, but you must do so correctly. :-) Your inner IF() below appears to have four arguments. Trying to get a condition

Nested IF statement in 3.23.57

2004-03-25 Thread David Perron
Are nested IF statements valid? Doesn't say anything here: http://www.mysql.com/doc/en/Control_flow_functions.html Trying to get a conditional count using the following statement - but Im receiving an error. I would use a CASE statement but my version doesn't support it. SUM(IF(AdGroups.Status

RE: Executing REPLACE from IF statement?

2004-03-01 Thread Pilarinos, Dionysios
And to finish it off, I just removed pb.ticker="SAP500" statement. -Original Message- From: Pilarinos, Dionysios Sent: Monday, March 01, 2004 4:56 PM To: [EMAIL PROTECTED] Subject: RE: Executing REPLACE from IF statement? After some thought, this is what I came up with

RE: Executing REPLACE from IF statement?

2004-03-01 Thread Pilarinos, Dionysios
ke this run for each pb.ticker without having to explicitly identify it in the script. Feel free to give me suggestions. -Original Message- From: Pilarinos, Dionysios Sent: Monday, March 01, 2004 3:53 PM To: [EMAIL PROTECTED] Subject: Executing REPLACE from IF statement? Hi, I was wond

Executing REPLACE from IF statement?

2004-03-01 Thread Pilarinos, Dionysios
Hi, I was wondering if someone can point out a way to make the below script update a row. Query: SELECT pb.ID, c.mdate, bc.mdate, IF(DATE_FORMAT(c.mdate,'%m/%d/%Y') = bc.mdate, "Same Date", "Not Same Date") FROM product_bench pb, current c, bench_current bc WHERE pb.ticker="SAP500" and c.ID=pb.I

If statement

2004-02-05 Thread Mike Tuller
I need some help with this. Here is the information from the MySql manual. IF search_condition THEN statement(s) [ELSEIF search_condition THEN statement(s)] ... [ELSE statement(s)] END IF IF implements a basic conditional construct. If the search_condition evaluates to true, the corresponding S

RE: "if" statement

2004-01-29 Thread David Perron
nt: Thursday, January 29, 2004 4:15 PM To: [EMAIL PROTECTED] Subject: "if" statement Hello all, I'm a newbie and I appreciate any help I can get for my basic question. For example,let's say I have a table with fields experience, vacation. I'm doing, select @exp:=exp

"if" statement

2004-01-29 Thread sakhiya
Hello all, I'm a newbie and I appreciate any help I can get for my basic question. For example,let's say I have a table with fields experience, vacation. I'm doing, select @exp:=experience from the table then I do some mathematical calculations with @exp variable. My question is how do I write sta

RE: strange warning when using an IF statement

2003-12-15 Thread Jay Blanchard
[snip] I keep getting the following error when I try to run an "if" statement Warning: 2 is not a valid MySQL-Link resource in then give the filename Here is what I am trying to do. if ($bumpnumber<4) { print ("display this"); }else { print ("display that"); }

strange warning when using an IF statement

2003-12-12 Thread Hunter, Jess
I keep getting the following error when I try to run an "if" statement Warning: 2 is not a valid MySQL-Link resource in then give the filename Here is what I am trying to do. if ($bumpnumber<4) { print ("display this"); }else { print ("display that"); } mysql_clo

RE: Very basic If statement problem

2003-03-01 Thread Don Read
en category works fine. I have two fields in > my database called "applique" and "puffyfoam" both are set up as tinyint(1) > because all I'm storing there is a zero for no and a 1 for yes. > > But for the screen output I don't want these codes to show, I'

RE: Very basic If statement still not working VERIFIED VARIABLES

2003-02-28 Thread Roger Davis
In your If statement (if this is still true) you are using... > if(($applique == 1) && ($puffyfoam == 0)) etc. But in your list you are using > {$row['applique']} Applique > {$row['puffyfoam']} P

Very basic If statement still not working VERIFIED VARIABLES

2003-02-28 Thread Stitchin'
se! -Original Message- From: Roger Davis [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: RE: Very basic If statement still not working Why don't you verify what the values are in the variables. If the Variables are not

RE: Very basic If statement still not working ????

2003-02-28 Thread Roger Davis
TECTED] Sent: Friday, February 28, 2003 12:01 PM To: [EMAIL PROTECTED] Subject: Very basic If statement still not working Boy, this is getting real frustrating ... doesn't this seem to be child's play? I'm not trying to do anything fancy ... I tried the && and paren

Very basic If statement still not working ????

2003-02-28 Thread Stitchin'
my database > called "applique" and "puffyfoam" both are set up as tinyint(1) > because all I'm storing there is a zero for no and a 1 for yes. > > But for the screen output I don't want these codes to show, I'd like a com- > ment to show up. So I set up t

RE: Very basic If statement problem

2003-02-28 Thread Stitchin'
t;applique" and "puffyfoam" both are set up as tinyint(1) because all I'm storing there is a zero for no and a 1 for yes. But for the screen output I don't want these codes to show, I'd like a comment to show up. So I set up this "if" statement to place t

add multiple records as a result from an if statement

2002-12-12 Thread Kaan Oglakci
Hi, I have a form with two sections on it. The user either completes one or both sections. (The validation is controlled by JavaScript) at the moment no matter how many sections they complete all the information is added to one record(through asp). But what I want to happen, is if the user