hi! i'm actually sort of newbie in this whole database world, but i have learned enough to somewhat defend myself, but i have come upon a situation where i cant think of a way to retrieve the data the way i need it, i just found out this forum existed and i think it's just great!
ok my real problem, i'll describe with a simplier example
lets say i have the following tables:
create table names(
id serial PRIMARY KEY,
I don't know and I can't imagine why are you needing something like that.
I've seen that you had an answer but I still want to make you an advice. That kind of solutions are sometimes very problematic. Sooner or later you will have to meke a change. It's better soon.
That kind of solution let's you out of inserting new records or colums without rebuilding the query.