Help needed in AdventureWorks in a sql query.
- by vaibhav
I was just playing with adventureworks database in sqlserver. I got stuck in a query.
I wanted to Select all titles from HumanResources.Employee which are either 'Male' or 'Female' but not both.
i.e if title Accountant is Male and Female both I want to leave that title.
I need only those titles where Gender is either Male or Female.
I have done this till yet.
select distinct(title) from humanresources.employee where gender='M'
select distinct(title) from humanresources.employee where gender='F'
Probably a join between these two queries, would work. But If you have any other solution, please let me know.
It is not a homework. :)
Thanks in advance.