RE: SQL syntax help

RE: SQL syntax help

 

  


Hello Sam,

Try using the decode stmt as:-

Select decode((select count(*) from tab_name where nvl(pupil_number) <> 0),
1, 'Y', 'N') from tab_name;

It should solve your problem.

Thanks and Regards,

Pravin

-----Original Message-----
From: Samuel Quantz
[mailto:oracledba-ezmlmshield-x21638366.[Email address protected]
Sent: Tuesday, January 08, 2008 10:07 PM
To: LazyDBA Discussion
Subject: SQL syntax help

Hello,

I am in the process of creating a view and for some reason I am having a
mental block.

For one of the fields I need it to present a 'Y' or 'N' for each
pupil_number(individual record).

If the pupil number exists in a separate table then I want the value to be
'N', otherwise it should be 'Y'.

I have looked at the decode function, but from the documentation it doesn't
seem to be exactly what I want.

Any help would be appreciated

Sam Quantz
DBA
Information Systems
Salt Lake City School District
(801)578-8329




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a dba
job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com To
unsubscribe: http://www.lazydba.com/unsubscribe.html








---
This e-mail message may contain confidential, proprietary or legally privileged information. It should not be used by anyone who is not the original intended recipient.If you have erroneously received this message, please delete it immediately and notify the sender. The recipient acknowledges that 3i Infotech or its subsidiaries and associated companies, (collectively "3i Infotech"), are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of 3i Infotech. Before opening any attachments please check them for viruses and defects.


Oracle LazyDBA home page