#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    23
    Rep Power
    0
    I have different tables with product. Every tables is a different category, and has prod_id, name, description, price and already sold(int, how many already sold). I want to make a top 10 most sold products.
    For this is have to make a query from different tables, sort by 'already sold' and limit to 10, but how to do this?
    This all in mySQL/PHP3.

    Thnx,
    Dave
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Location
    London
    Posts
    110
    Rep Power
    0
    use a join stmnt in your sql query.

    ------------------
    cheers
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    23
    Rep Power
    0
    Every product has a unique prod_id. There is only one prod_id "1" in all the tables. That's the problem. How do I then use a join statement?

    Any other sugestions?

    Dave
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    63
    Rep Power
    15
    select distinct product_sales_count.product_id, product_mstr.product_description from product_sales_count, product_mstr where product_sales_count.product_id = product_mstr.productid order by product_sales_count.quantity limit 0,30

    Ulysses J Ludwig
    310.678.8324
    ujludwig@yahoo.com

Similar Threads

  1. FULLTEXT search multiple tables single query
    By mcalwell in forum MySQL Help
    Replies: 0
    Last Post: February 5th, 2004, 12:15 PM
  2. Replies: 2
    Last Post: January 28th, 2004, 08:07 AM
  3. SQL Query question (Joining tables with missing rows)
    By LiquidKernel in forum MySQL Help
    Replies: 4
    Last Post: January 17th, 2004, 11:20 PM
  4. Replies: 1
    Last Post: December 19th, 2003, 11:12 AM
  5. tables get corrupted
    By 90coders in forum MySQL Help
    Replies: 1
    Last Post: December 5th, 2003, 06:23 AM

IMN logo majestic logo threadwatch logo seochat tools logo