Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. rayfinkel2

    ORDER BY problem with JOINs

    Thanks for the help ceco, I am sorry, but I posted to so many forums that I forgot to put my final answer on this forum. The conclusion that I came to (with a lot of help from a couple of forums) is this final query. And it works great and seems to execute very quickly. What I forgot...
  2. rayfinkel2

    ORDER BY problem with JOINs

    Here is my problem and it appears that it may only be a problem with PostgreSQL: I am trying to order the products on my online store showing the products that have been sold the most amount of times within the last week on the top. There are a lot of products that may not have been sold...
  3. rayfinkel2

    Order Products Based On Sales

    Well, i think I finally figured it out. Here it is: SELECT orders_prods.prod_id, SUM(orders_prods.quantity) AS quantitySold, products.thumbnail, products.main_image, products.prod_price, products.prod_id, products.prod_name FROM products INNER JOIN product_categories ON products.prod_id =...
  4. rayfinkel2

    Order Products Based On Sales

    maybe a subquery to determine whether something has sold in the last week? Help Please
  5. rayfinkel2

    Order Products Based On Sales

    But, I need it to show all the products whether they have sold or not.
  6. rayfinkel2

    Order Products Based On Sales

    I know it's: "AND orders_prods.order_date > '$dateSevenDaysAgo' " thats limiting the whole selection to only the products it finds sold within the last week, but I need it to limit this query to order by sales within the last week.
  7. rayfinkel2

    Order Products Based On Sales

    I received some help on another forum and I almost have this query working now. The only problem I am having is that it doesn't pull every product out of the products table because there is not always a prod_id in the orders_prods table to match the prod_id in the products table (especially...
  8. rayfinkel2

    Order Products Based On Sales

    I am trying to order products in our online store based on sales. For instance, if one product sold 15 times last week, it would be shown above a product that sold 8 times last week. This is a typical online store with a database consisting of a products table, orders table (containing...

Part and Inventory Search

Back
Top