I have a personal question if you don't mind -- I do some SQL query generation and transpilation for both work and hobby.
One headache I've run into recently is generating nested EXISTS() subqueries.
WHERE EXISTS(SELECT 1 FROM Albums WHERE Albums.ForeignKey = t.PrimaryKey
AND EXISTS(SELECT 1 FROM Tracks WHERE Tracks.ForeignKey = Albums.PrimaryKey AND AlbumId = 40))
How to do this is giving me a headache for a lot of reasons and I can't seem to come up with a good way.
Any tips, references, or search terms to google?
Thank you, look forward to digging in more + gave your repo a star!
i rarely ever use exists and prefer to do left joins or left semi joins (in spark)
i'm not exactly sure what you're asking though, in terms of sql generation, it's not difficult for me because i just take in sql and output sql from the ast
I have a personal question if you don't mind -- I do some SQL query generation and transpilation for both work and hobby. One headache I've run into recently is generating nested EXISTS() subqueries.
Imagine you have something like this:
This is all fine, but what if you want to say "A binary operation on related entities": Which you want to generate something like: How to do this is giving me a headache for a lot of reasons and I can't seem to come up with a good way. Any tips, references, or search terms to google?Thank you, look forward to digging in more + gave your repo a star!