how to select, average and sort in mysql table

后端 未结 2 1585
Happy的楠姐
Happy的楠姐 2021-01-29 11:10

i have a table in mySql like in this picture
\"enter

and i want to write a query which

2条回答
  •  天命终不由人
    2021-01-29 11:32

    don't know if you're looking for something like this:

    SELECT fields_list, (field_to_modify + (SELECT AVG(average_field) FROM table2)) AS order_field 
      FROM table1
    WHERE your_conditions
      ORDER BY order_field;
    

提交回复
热议问题