[email protected] writes:
I need an help with lateral subqueries:
is it possible to perform it with a dynamically generated column name?
No it is not. SQL is a statically typed language, the SQL engine
(parser, executor) needs to fully determine the data type of the result
of the query before running it.
column_name
------------------------------------
user_id
warehouse_resume_attribute_user_id
resume_attribute_000m1_2
resume_attribute_00032_13
resume_attribute_00052_13
resume_attribute_00053_13
resume_attribute_00057_4
resume_attribute_00058_7
resume_attribute_00059_6
resume_attribute_00061_3
This looks like an EAV data model, which is the worst possible choice on
earth in the relational world. Normalize your data model and then it's
going to be very easy (and efficient) to write your queries.
Regards,
--
Dimitri Fontaine
https://masteringpostgresql.com
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)