Could you tell me how to write the SQL of the top 10 users who get the order amount?

have the following two sample tables

order amount is equal to orderinfo price*count in the table, and each order has more than one item.

how can I get the top 10 users with the total amount of orders through the SQL statement?

add: each user may also have multiple orders

Feb.28,2021

< H2 > as shown in figure < / H2 >

order

orderinfo

< H2 > execute SQL: < / H2 >
  

add an extra field in the order table to store the total amount of orders with appropriate redundancy to facilitate query

Menu