Access - Tricky SQL statement -
i have access database contacts, phone numbers, fax, mobile. example:
table: numbers name number type george 555555 phone george 656565 phone george 323232 fax michael 656565 phone john 323232 fax steve 234345 mobile
i want select person has phone number 656565 and fax number 323232, namely here george , not michael or john. (name foreign key if helps) sql statement?
one possibility set out below, answer will, think, depend on [name] being unique key in whatever table from:
select [name] numbers type = 'phone' , [number] = '656565' , [name] in (select [name] numbers type = 'fax' , [number] = '323232')
i have assumed number text field because phone numbers stored text.
Comments
Post a Comment