Normal SQL ville simpelthen bruge
SELECT COLUMN1, COLUMN2, COLUMN3, COLUMN4 from <TABLE>
så sandsynligvis noget lignende
@Query("SELECT " + desiredSubcategory1 + " AS subcategoryValue1 + "," +
desiredSubcategory2 + " AS subcategoryValue2 + "," +
desiredSubcategory3 + " AS subcategoryValue3 + "," +
desiredSubcategory4 + " AS subcategoryValue4 + "," +
"FROM subcategory_table")
List<Subcategory> getSubcategory(String desiredSubcategory);