am a having a table 'PROGRAMMER' with columns PNAME,LANGUAGE1,LANGUAGE2... as shown below
pname Language1 Language2 Trinadh C pascal Bhanu Sql DBASE Sudheer Cobol Pascal Gopi Pascal Sql Mahesh DBASE Cobol Gopal oracle C
Now i need to write a query "which language is known by only one programmer"
Plz any one help meeeeeeeeeeeeeee
Hi try this sql query,
SELECT LANGUAGE1 from (SELECT LANGUAGE1 FROM programmer where prof1 not in (SELECT LANGUAGE2 FROM programmer)) group by LANGUAGE1 having count(LANGUAGE1) = 1 UNION SELECT LANGUAGE2 from (SELECT LANGUAGE2 FROM programmer where prof2 not in (SELECT LANGUAGE1 FROM programmer)) GROUP BY LANGUAGE2 HAVING COUNT(LANGUAGE2) = 1