1

Hello i have a very old and BIG query which gous like this:

select id, someValue, (select x from y inner join x on x.y = y.zzz) as filter

Now i need to filter for the deliverd variable like

select id, someValue, (select x from y inner join x on x.y = y.zzz) as filter
WHERE filter not 'badPractise'

Is there any way i can use it without making the same join in the where clausule?

1 Answer 1

1

Yes you can use HAVING clause to filter out with your filter column

select id, someValue, 
(select x from y inner join x on x.y = y.zzz) as filter
FROM ....
HAVING filter <> 'badPractise'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.