Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi all,
Can any one give answer for this question.
Suppose im having employee table with fields, eno, ename,
dept, address1, address2, address3.
In address field employee can fill only address1 or address2
or address3... at a time he can fill three address fields.
now i want all employee names who filled only one address
field.. Plz its urjent can any one give querry.. Thanks in
advance.

Answer Posted / nathan

WITH temp AS
(SELECT 1 ID, 'delhi' add1, 'mumbai' add2, 'guj' add3
FROM DUAL
UNION ALL
SELECT 2 ID, NULL add1, 'mumbai' add2, NULL add3
FROM DUAL
UNION ALL
SELECT 3 ID, 'delhi' add1, NULL add2, 'guj' add3
FROM DUAL)
SELECT *
FROM (SELECT ID, NVL (add1, 0) + NVL (add2, 0) + NVL
(add3, 0) address
FROM (SELECT ID, DECODE (add1, NULL, NULL, 1) add1,
DECODE (add2, NULL, NULL, 1) add2,
DECODE (add3, NULL, NULL, 1) add3
FROM temp))
WHERE address = 1;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an oracle recycle bin?

978


Is it possible to split the print reviewer into more than one region ?

2259


Point the difference between translate and replace?

1068


What do you mean by cdb and pdb in oracle 12c?

1039


How to lock and unlock a user account in oracle?

1081


What are the numeric comparison operations?

1093


How to use values from other tables in update statements using oracle?

1066


How to check the server version in oracle?

1077


Typically, where is the conventional directory structure chosen for Oracle binaries to reside?

2119


How to work with data objects interactively?

959


How do I decide when to use right joins/left joins or inner joins or how to determine which table is on which side?

1002


I have a database backup file in .db (ext) form how to conver it into .dmp (ext.) for oracle database

2111


How do I manually uninstall oracle client?

1069


Explain the difference between a procedure and a function?

1143


Explain oracle left join with an example?

986