Hi, I have these config in postgre:
I would like to get all registers that don't have "NAME=SIZE" IN THE TABLE VARIABLE. So the output should be:
If I make a where with job_id and table_id shows me all registers. Someone could help me please? Thanks and sorry for my English!
I wanted to post only SQL, but can't, have to make it look like a "sentence" because of this site's damn parser:
SELECT VARS.ID_JOB, VARS.ID_TABLE, VARS.NAMEJOB
SELECT ID_JOB, ID_TABLE
GROUP BY ID_JOB, ID_TABLE
HAVING MAX(CASE WHEN NAME = 'SIZE' THEN 1 ELSE 0 END) = 0
) AS VARS
INNER JOIN DEF ON DEF.ID_JOB = VARS.ID_JOB AND DEF.ID_TABLE = VARS.ID_TABLE
Thanks it's a good approximation.
Gives me more registers than expected.
But I'm culprit.
I forget mention that in DEF TABLE there is other column (called TYPE) where I must obtain all of TYPE=C. Because in VARIABLE there are a lot or register and not all are of the type C.
If I use your query gives me all types and not only of type C.
Thanks and sorry for my English!