php - MySQL: order by sum
I have article table
`id`, `article_id`, `stage_1_point`, `stage_2_point`
I need top 10 articles based on
in the list and when i view any article i need to show its place. My question is how can show its place without using order by.
ORDER BY (stage_1_point+stage_2_point) DESC
So, It will be like
As OP stated, he/she needs to know the position of specific article.
Above query will return rows for article_id 10, which will have a column
Rankwhich tells the position of the article.
You can try below Query as below
This will sort data based on column one result and fetch top 10 results only.