Welcome Guest, Not a member yet? Register   Sign In
If query
#1

[eluser]Cosai[/eluser]
I want a query like this:

IF sometable.id=-1THEN
select "" as name1
ELSE
select othertable.name as name1
END
From sometable,othertable
LEFT JOIN
sometable.id=othertable.sid

There are some fields on sometable that doesn't (shouldn't) match on othertable. If the field matches then I need to get name on other table else the name should appear 0

(Don't ask me why is it like that. Someone has done this sh.tty database design)

also is it possible to start a query then before taking result of that starting another query?

Thank you for your help.


Messages In This Thread
If query - by El Forum - 06-09-2013, 11:54 PM
If query - by El Forum - 06-10-2013, 01:58 AM
If query - by El Forum - 06-10-2013, 04:20 AM
If query - by El Forum - 06-10-2013, 06:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB