Re: IF ..THEN

From: Date: Tue, 06 Nov 2001 22:29:01 +0000
Subject: Re: IF ..THEN
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14078@lists.php.net to get a copy of this message
Hi You want to be using PL/SQL for this - its a Procedural Language in SQL. (not in mySQL AFAIK though). You could write this in PL/SQL, making it a function which you'd then call from PHP. The documentation for your database should describe how to do this. -- Shane On Tuesday 06 November 2001 9:27 pm, Sharif Islam wrote: > Is it possible in SQL to look into two different tables depending on the > data? > > For example: > > Name Attribute > X S.Black > Y S.Blue > Z T.White > W T.Red > > can i do something like this? > > IF Attribute=S.(something) THEN > look into Table 1 and return col1 > else > look into Table2 and return col2. > > I am using S. and T. as substring to separate the data.I guess then when I > will display it , i have to parse it to. Any hint? > > thanks > > > > > > ) > (( > > |""|-. > | > | :|/' > > -`--'-

« previous php.db (#14078) next »