--- 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
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
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.
--
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
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
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
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
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
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
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
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
>
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.
>
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
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
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
- 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
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
>
>
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,
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
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
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
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
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
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
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
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
[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");
}
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
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'
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
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
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
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
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
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
35 matches
Mail list logo