V
V
Vlad_Lop122021-03-29 16:18:18
Python
Vlad_Lop12, 2021-03-29 16:18:18

How to display data from database in ascending order?

Hello!
I have a task.
There is a database with 2 columns Name and Balance. There are 10 names and their accounts in the database.
How to display the 3 richest names? In the format:
1. Ivan 1000
2. Petya 403
3. Gena 399
Tell me, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2021-03-29
@sergey-gornostaev

Easily. These are the very basics of SQL.

V
Vlad_Lop12, 2021-03-29
@Vlad_Lop12

SELECT * FROM user ORDER BY balance DESC LIMIT 10
Read the basics of sql.
Topic closed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question