View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 10:29 AM
houghi
 
Posts: n/a
Default Problems working with INNER JOIN

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.

houghi
--
They say pesticides have been linked to low sperm counts.
In my opinion if you have bugs down there that are so bad
you need to use a pesticide, you're not gonna get laid anyway.
Reply With Quote