473,624 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select top five products

pradeepjain
563 Contributor
Hii guys,
I have a list of products in a table and there is a column called rating which is a value between 1-10 . i need to select top 5 rated products . is there any ways to do this in a single sql statement or any other method to do it .
Mar 4 '10 #1
1 2183
Atli
5,058 Recognized Expert Expert
Hey.

Yea, you do a normal SELECT query, but add: "ORDER BY `rating` LIMIT 5"
Mar 4 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
1426
by: Oli | last post by:
Hi In my company one of the people who works for me has done this: sqlText = "SELECT products.ProdID, productName, " _ & "productPrice, quantity from products, " _ & "itemsOrdered where " _ & "products.productID = itemsOrdered.productID "_ & "and itemsOrdered.orderID = " & intOrderID
0
2535
by: Mike Morton | last post by:
Runnint Mysql 3.23.47 I have the following two tables: backorder_notification ->product_code varchar ->email varchar ->date_added date Products ->code varchar ->name varchar
1
1408
by: mike | last post by:
hi, i have a products database and a sales database. i have product id field in both which relates to a given product. i would like to have a query who's result tells me the total cost of the products sold in the given time period. i am having trouble with the cost price query.
14
45457
by: Craig Hoskin | last post by:
Hi everyone Have a problem I would areally appreciate help with. I have 3 tables in a standard format for a Bookshop, eg Products Categories Categories_Products the latter allowing me to have products in multiple categories.
12
6531
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
4
13744
by: Mintyman | last post by:
Hi, I have a SQL query: select products.name, products.notes, products.purchase_date, products.serial_no, products.total_value, products.product_code, products.quantity, products.product_group, products.lhs1_name, lhs1.department, lhs1.address1, lhs1.city, lhs1.country from products, lhs1 where products.lhs1_id = lhs1.id
23
82010
by: Brian | last post by:
Hello All - I am wondering if anyone has any thoughts on which is better from a performance perspective: a nested Select statement or an Inner Join. For example, I could do either of the following: SELECT supplier_name FROM supplier
2
1910
by: TD | last post by:
I have this expression in the criteria section of a query: IIf(Forms!frmReports!cboProductID="<ALL PRODUCTS>",. Like "*",Forms!frmReports!cboProductID) (the syntax of the above expression may not be exact because I'm trying to write it from memory us now) I have a form with a combo box that I fill from a Union query that adds the phrase "<ALL PRODUCTS>" so that when you click on this combo box
1
2615
by: rajesh | last post by:
How to invisible the scrollbar in select box OR Drop down box in mozilla. <SELECT NAME="list2" id="list2" MULTIPLE SIZE=20 style="width:100px;"> <OPTION VALUE="One">One</OPTION> <OPTION VALUE="Two">Two</OPTION> <OPTION VALUE="Three">Three</OPTION> <OPTION VALUE="Four">Four</OPTION> <OPTION VALUE="Five">Five</OPTION>
4
10660
tjc0ol
by: tjc0ol | last post by:
Hi guys, I'm a newbie in php and I got error in my index.php which is: 1054 - Unknown column 'p.products_id' in 'on clause' select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,...
0
8238
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8624
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.