Say I have the following table:
--------------------
|ID|Yes|No|Filename|
|01|15 |10|1.php |
|02|12 |5 |2.php |
|03|6 |1 |3.php |
--------------------
What I want to do is apply Yes/Yes+No in an sql select statement and echo the highest value’s filename.
The Yes and No are updated from time to time, so would it be better to create another column to handle the equation, or can an equation be used in a sql statment? And what would the select statment look like for this?
Thanks
for
MySQL,SQLFiddle Demo
for
SQL ServerSQLFiddle Demo