Results 1 to 3 of 3
  1. #1
    kennyritch
    Guest

    Access Query -> MySQL Query (2000 9.0.2720)

    Hi Folks

    Can someone help 'cos I'm a bit new to this whole database stuff. I've used Access to generate an SQL query which I now intend to replicate in MySQL (the query is shown below). However, I keep getting an error when I try and design it in MySQL. Can anyone tell me how to port this Access query to MySQL successfully?

    SELECT traders.id, traders.name, fresh_produce.description, fresh_produce.phone
    FROM (Bakery INNER JOIN traders ON Bakery.id = traders.id) INNER JOIN fresh_produce ON traders.id = fresh_produce.trader_id;

    Thanks for any help,

    Kenny

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Access Query -> MySQL Query (2000 9.0.2720)

    Hi,
    First a confession - I've never used MySQL. However, for a 'standard' (hah!) SQL version, I would try this:
    SELECT traders.id, traders.name, fresh_produce.description, fresh_produce.phone
    FROM Bakery, traders, fresh_produce WHERE Bakery.id = traders.id AND traders.id = fresh_produce.trader_id;

    Note: I've left Bakery in there even though you don't appear to be using it. If you don't need it then this should work:
    SELECT traders.id, traders.name, fresh_produce.description, fresh_produce.phone
    FROM traders, fresh_produce WHERE traders.id = fresh_produce.trader_id;

    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    kennyritch
    Guest

    Re: Access Query -> MySQL Query (2000 9.0.2720)

    Thanks very much Rory - worked a treat!

    Cheers,
    Kenny.

Posting Permissions

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