PDA

View Full Version : Problems working with INNER JOIN



MILANA
14 Nov 2007, 09:05 AM
I have a query that gies me the distice from a postalcode to a store. It
gives me the five closest stores:

SELECT `store_id`
FROM `distance`
WHERE `postcode` =3000
ORDER BY `distance` ASC
LIMIT 0 , 4

Output is here
1080
1008
1121
1073

I also have a query that will give me the data from the store:
SELECT `StoreNumber` , `StoreName` , `Address` , `ZipCode` , `City` ,
`StorePhone`
FROM `stores`
WHERE `StoreNumber` =1080
LIMIT 0 , 30

Now obviously I would like to have a query that wll give me an outpit
like:
1080 Store_X Street_X 3000 Leuven 016/123456
1008 Store_B Street_B 3200 Aarschot
1121 Store_Z Street_Z 2000 Antwerpen 03/1234567
1073 Store_A Street_A 9000 Gent 09/1234567

How can I achieve this? I have looked, yet when I try I get an error
that there is more then one line.
_________________
[deleted link]