Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 display of results

Author  Topic 

seed
Starting Member

3 Posts

Posted - 2015-02-26 : 11:44:42
hi all,i am writing an sql query on formula one teams.
each team has two drivers,i am trying to do a query which will return the drivers name as well as the team he races for if he is the lead driver, the sql i have below only seems to return half the lead drivers

SELECT DRIVER.NAME,F1_TEAM.NAME
FROM DRIVER,F1_TEAM (these are my tables)
WHERE DRIVER.STATUS='LEAD'
AND
DRIVER.DRIVER_ID=F1_TEAM.TEAM_ID

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-26 : 12:23:30
Please show us sample data and expected output.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -