Records Duplicating after a Join
- From: Wez <Wez@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 17 Jun 2005 10:07:07 -0700
I have two tables as follows:
Orders (ORDERID, CODE, ORDERQTY)
and
STOCK (CODE, LOCATION, STOCKQTY).
I am running a query that will display all the records in the Orders table,
and also a valid location for that code i.e. Fields returned are:
ORDERID, CODE, ORDERQTY, LOCATION
I am using an INNER JOIN to get the result.
This is fine if there is only one location per code but if I have multiple
locations for a code then the result set will show all locations (therefore
duplicating rows).
How do I just display one location code for each record in the orders table?
I dont mind which location code it is - I just need to avoid having multiple
records returned!
Thanks,
Wez
.
- Follow-Ups:
- Re: Records Duplicating after a Join
- From: Hugo Kornelis
- Re: Records Duplicating after a Join
- Prev by Date: Query ... Distinct rows
- Next by Date: Re: Query ... Distinct rows
- Previous by thread: Query ... Distinct rows
- Next by thread: Re: Records Duplicating after a Join
- Index(es):
Relevant Pages
|
|