Hello I have looked on these forums and I need help with getting name of column based on value.
For example I have a table such as:
|Name | Column1 | Column2 | Column3|
|-----------------------------------|
|Peter | 100 | 120 | 92 |
|-----------------------------------|
|James | 110 | 105 | 88 |
|-----------------------------------|
|David | 90 | 112 | 98 |
I want to do a query of Peter where the value is 92 and I need the query to return Column3.
I know very basic sql and have not really used sqlite to understand it in depth.
I searched and the best I found was this thread which does have a solution that works on mysql: Get column name dynamically by Specific row value.
I tested this and it does exactly what I would like. Of course it's not for sqlite.
I need to know if this can be done using sqlite and if so, what is the proper syntax? Again I know very basic SQL.
If anyone has any tips/advice I appreciate it.