I have many columns which are of the form: rp_id_1 rp_id_2 and so on. I want to get data for these specific columns. On the forum I see below type of query being suggested:
"SELECT column_name
FROM information_schema.columns
WHERE table_name='loc_tbl'
AND column_name LIKE 'rp%'"
However this only returns the column names and not the data. Output:
+-------------+
| column_name |
+-------------+
| rp_id_1 |
| rp_id_2 |
| rp_id_3 |
What am I missing? How do I get the data for all these columns instead? Thanks.