0

how to select the first maximum prices in a table without using the clause "where" ?

Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709
Sara Stone
  • 161
  • 1
  • 9

4 Answers4

1

In mysql -

SELECT * FROM table_name
ORDER BY price desc LIMIT 50;
Nick
  • 123,192
  • 20
  • 49
  • 81
Khilesh Chauhan
  • 547
  • 5
  • 24
1

this will work in mysql:

SELECT 
    select_list
FROM
    table_name
order by column_name
LIMIT 0 , 50;
nikhil sugandh
  • 3,422
  • 4
  • 16
  • 29
0
SELECT price
FROM table
ORDER BY price DESC
LIMIT 50;
BobLee
  • 46
  • 3
0

Your question is unclear.

If you want 50 rows, even when there are duplicates, then you can use:

select price
from t
order by price desc
limit 50;

If you want 50 distinct prices, then you can use:

select distinct price
from t
order by price desc
limit 50;
Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709