March 8, 2007 at 7:02 am
I've got 2 tables and would like to do a Count on 1 table whilst checking against a second table, is this possible?
table1 table2
[name] [age] [Location] [name] [job]
fred 20 London george driver
george 20 London tony plumber
tony 20 paris alice driver
jim 21 Milan fred plumber
the sort of query I need is
count from table1 where names are also in table2 that are drivers
any ideas?
March 8, 2007 at 11:26 am
select count(*) from
table1 inner join table2
on table1.name = table2.name
where table2.job = 'driver'
Russel Loski, MCSE Business Intelligence, Data Platform
March 9, 2007 at 2:43 am
many thanks Russel
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy