Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
591 B
9
Indexable
Never
limit & order by clause

select * from Customers where age>22 order by first_name desc, last_name desc  limit 1;--
--insert into Customers values(6,"john","Doe",31	,"USA");

offset:- limit with offset
syntax:-select * from table_name limit offset_value, rowlimit

select * from Customers order by first_name desc limit 2, 3;


Group by clause:
group by clause is use for grouping data.
group by clause is used with aggregate function .(count(),sum(), avg(), min(), max())

select  count(customer_id) as count ,country from  Customer  
group by country order by country desc ;
Leave a Comment