By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,363 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,363 IT Pros & Developers. It's quick & easy.

query help

P: n/a
hi,

I have tried but just cannot work it out so i am asking for help.. please
:-)

I have a query that does this:

select all the records in sales that don't have a corresponding record in
commissions based on a field called imei in both.
(this will tell me what records i have in my sales database that my supplier
has not paid me commission for).

but as i have more than one supplier i now need to amend the query to ask
the same info but also to get the supplier from a third table. so i want to
ask:

select all the records in sales that don't have a corresponding record in
commissions based on a field called imei in both AND in the results also
display the supplier which can be found in a table called handsets that also
has a field called imei

imei is unique in each table.. handsets,commissions and sales and there
should be a record

everytime i try to right it it brings back many thousands of records in
stead of a few hundred as expected.

thanks, your help is appreciated.

sean
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
FRED wrote:
select all the records in sales that don't have a corresponding record in
commissions based on a field called imei in both.
(this will tell me what records i have in my sales database that my supplier
has not paid me commission for).

but as i have more than one supplier i now need to amend the query to ask
the same info but also to get the supplier from a third table.


Perhaps:

select * from supplier
left join supplier on supplier.id=sales.supplier_id
left join commissions on sales.imei=commissions.imei
where commissions.imei is null;
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.