I am new to SQL so please be gentle.
I have three tables A, B and c. I am selecting from a JOIN on these three tables. There are three cases:
if value1 in A > value2 in A
do something, ie. UPDATE tables A, B and C
else if value1 in A = value2 in A
do something else
else if value1 in A < value2 in A
do something else.
Is there any way of writing something like
IF value1 FROM A > value2 FROM A
The closest I can get to that is
IF(SELECT value1 FROM A) > (SELECT value2 FROM A)
This causes an error.
I hope I am making sense. Please dont hesitate to reply if you would like me to clarify the problem
Thank you.
I have three tables A, B and c. I am selecting from a JOIN on these three tables. There are three cases:
if value1 in A > value2 in A
do something, ie. UPDATE tables A, B and C
else if value1 in A = value2 in A
do something else
else if value1 in A < value2 in A
do something else.
Is there any way of writing something like
IF value1 FROM A > value2 FROM A
The closest I can get to that is
IF(SELECT value1 FROM A) > (SELECT value2 FROM A)
This causes an error.
I hope I am making sense. Please dont hesitate to reply if you would like me to clarify the problem
Thank you.