Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by zq29

  1. Confusing title? I couldn't explain it any other way in such a small field! Ok, here goes...

     

    product

    id, name, description

     

    product_option

    id, product, name, price

     

    I'm trying to display a list of products, each with its cheapest option as the display price.

     

    SELECT p.*, po.`price` 
    FROM `product` as p
    LEFT JOIN `product_option` AS po ON p.`id` = po.`product`
    ORDER BY po.`price`

     

    This query returns duplicate data, one almost identical row per option, with the price differing. To be expected. I'm having difficulty only returning one row per product, with the price of the cheapest option. I tried adding a GROUP BY p.`id`, and this cut it down to one row per product, but it was not displaying the cheapest price, it displayed the price with the lowest id in the product_option table. Ordering before Grouping returns errors...

     

    Am I attacking the task from the wrong direction, can someone point me in the right way? Many thanks.

  2. I would have thought the speed difference between different database software products is minimal. I'd imagine the difference is made on how well you optimize your queries and the hardware that is running the server(s). Something like WoW probably utilises a silly amount of physical machines...

  3. 22 and single here - Though, I prefer it that way at the moment. Running a successful business and in the middle of another start-up consumes a lot of my time. I also like my own space, and having a social anxiety disorder doesn't help much.

     

    There's time for all that later in life when I have less on my plate. Not an immediate concern for me.

  4. I'm now currently using Bluefish - Out of the handful of editors I have tried under Ubuntu, it works the best for me, though not perfect. I find that it takes a couple of seconds to open files regardless of their size...

     

    My editor is ever changing - I'm now using one called Geany. I think I might stick with this one, good syntax highlighting; fast; built-in function suggestion (including user defined functions) etc.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.