Sorry for if it is a silly question. I can order my column in ORDER BY
function and I can use LIMIT
function but it gives me only top value but I need each top value limitation.
So my dummy table is here:
Col-a col-b
A 1001
B 1000
B 999
C 998
A 997
C 996
A 995
A 994
A 993
A 992
B 991
C 990
my expectation is (LIMIT 3;)
col_a col_b col_a col_b col_c col_d col_e col_f
A 1001 A 1001 B 1000 C 998
B 1000 A 997 B 999 C 996
B 999 A 995 B 991 C 990
C 998 or
A 997
C 996
A 995
B 991
C 990
I Used FIELD()
but unfortunately I could not manage. How can we order that specific call.
ORDER BY function order order all values but I need take each value a specific number. When I use LIMIT
function only cut top values
Question is How can Order each different value in "1 Column"
EDIT: I tried
SELECT col_a,col_b FROM my_table
order BY FIELD(col_b, 'A','B','C') limit 100;