To sort a table columns in ascending or descending order you use ORDER BY clause.
Using ASC and DESC you can get the result in ascending or descending order. You can also apply both order for different columns at the same time.
SELECT name, address FROM users WHERE state = 'AL' ORDER BY user_id DESC, post_date ASC;
Using LIMIT clause you can get limited rows from the table. It accepts two parameters i.e. offset and count.
– offset specifies the offset of the first row to return
– count specifies the no of rows to return from the offset
SELECT name, address FROM users WHERE state = 'AL' LIMIT 0,10;
is same as
SELECT name, address FROM users WHERE state = 'AL' LIMIT 10;
Or use
SELECT name, address FROM users WHERE state = 'AL' LIMIT 5,10;
Cryptocurrency has transformed from a digital experiment into a global financial force in just over…
Introduction Layoffs have always been a part of corporate life, but the way they’re happening…
Relocating is often an exciting milestone, whether you’re starting a new job, heading to college,…
When you select cheap domain names, it can have a significant impact on the success…
Shared hosting struggles to keep up the performance commitment. Therefore, low-cost VPS hosting is an…
Does your melasma return every summer despite months of treatment? Melasma appears as brown or…