There in no way to pick columns based on expressions, variables, parameters, etc. SQL doesn't allow that as there'd be no way to determine which index might be usable.
You can't do this in one query. You have to get the names from your meta table in one query, and from those results, write application code to build the query for your main table.
Try to fix your main table to have more human readable column names.
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --