I have 2 tables with some columns and another table that I want its rows as columns to the view.
table1
uid|atr1|atr2|atr3
table2
uid|col1|col2
profile_fields(this is a dynamic table, thats why its rows)
fid|name
profile_values
fid|uid|value
so In the end I want a view like that and 1 row for each uid:
View
uid|atr1|atr2|atr3|col1|col2|name(all row names here from profile_Fields)|
and 1 entry row for each uid with all its user data and values
I dont understand how to make the view with the profile_fields because it has rows and not columns. It worked without this table in the first place but can’t make it work like I explained above.
You should use a pivot table mechanism, e.g. –
Then join this query to your tables.