| if condition [message #411408] |
Fri, 03 July 2009 07:25  |
rajasekhar857 Messages: 415 Registered: December 2008 |
Senior Member |
|
|
hi i am having a query like this.
SELECT TRANSFER_TYPE from EMRTransferedPatients WHERE TRANSFER_TYPE='Temporary' AND PATIENT_ID=
UNION SELECT TH.TRANSFER_TYPE from EMRTransferedPatientsHistory TH,
(SELECT PATIENT_ID,MAX(TRANSFER_DATE) as TRANSFER_DATE FROM EMRTransferedPatientsHistory GROUP BY PATIENT_ID) TEMPTBL
WHERE TEMPTBL.PATIENT_ID=TH.PATIENT_ID AND TEMPTBL.TRANSFER_DATE=TH.TRANSFER_DATE
AND TRANSFER_TYPE='Temporary' AND TH.PATIENT_ID =
can ypu help me out as in using if condition with query is succesfull then returns 1or returning zero
|
|
|
| Re: if condition [message #411412 is a reply to message #411408] |
Fri, 03 July 2009 07:39   |
S.Rajaram Messages: 932 Registered: October 2006 Location: United Kingdom |
Senior Member |
|
|
If you could give us a sql which is working and syntatically correct (Prove it) only then we will be able to help you out. Until then happy learning sql
Regards
Raj
|
|
|
| Re: if condition [message #411414 is a reply to message #411408] |
Fri, 03 July 2009 07:43   |
Michel Cadot Messages: 28985 Registered: March 2007 Location: Nanterre, France, http://... |
Senior Member |
|
|
From your previous post among many:
| Michel Cadot wrote on Fri, 03 July 2009 10:55 | Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).
|
Why are you so contemptous towards who help you?
Regards
Michel
|
|
|
| Re: if condition [message #411418 is a reply to message #411408] |
Fri, 03 July 2009 07:56   |
JRowbottom Messages: 5254 Registered: June 2006 Location: Sunny North Yorkshire, ho... |
Senior Member |
|
|
| Quote: | can ypu help me out as in using if condition with query is succesfull then returns 1or returning zero
|
Can you help us by explaining clearly and concisely, ideally with an example, what it is that you're trying to do.
|
|
|
|