Results 1 to 1 of 1

Thread: Problems working with INNER JOIN

  1. #1
    Join Date
    Nov 2007
    Posts
    3

    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.
    _________________
    [deleted link]
    Last edited by alvo; 14 Nov 2007 at 10:54 AM. Reason: New users aren't allowed signatures

Similar Threads

  1. Problems hyperlinking to certain file types
    By a_south in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 09 Jul 2007, 06:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •