Page 1 of 1

using if block without using procedures...

Posted: Wed Mar 29, 2006 3:33 am
by raghavan20
I want to use a if like statment or ternary operator to make a logical decision but I am not interested to write procedures.

Let's say I get a whether the requested quantity is greater than available quantity from a select statement and store it into a variable and then I have to make assignment statements based on what value is returned.

for ex:
requested quantity = 3
available quantity = 4

if requested quantity < available quantity
final quantity = requested quantity
else
final quantity = available quantity

this logic has to be someway made into mysql logical statements...thanks for any ideas...

Posted: Wed Mar 29, 2006 8:35 am
by feyd
is the IF() construct that confusing?