0

Here is my table: enter image description here

My statement is returning this: enter image description here

But I want it to return this: enter image description here enter image description here

Steve
  • 1
  • You have to use dynamic sql for this https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html – P.Salmon Dec 28 '22 at 16:42
  • Use `CASE` to select the column you want, based on `@columnname`: https://stackoverflow.com/a/47094290/378779 – kmoser Dec 28 '22 at 17:44

0 Answers0