DEV Community


Discussion on: What is a SQL query you are proud of?

daveskull81 profile image
dAVE Inden Author

Wow! That looks amazing. That is the most complex SQL query I have seen. Thanks for sharing!

Thread Thread
zoltanhalasz profile image
Zoltan Halasz

Actually, there are 2 columns i need to eliminate all empty characters. This is a temporary solution, will not be present in the final product. This makes it messy.

Thread Thread
j1cordingley profile image

If you need help to remove all the replaces. I can help right now I am on my phone and it hard to see exactly what happening but I also agree a cross or outer apply is needed(cross apply vs outer apply is like a inner join where it will on show records on both side where outer apply will return like a left join of all records on the left)

With apply you use it like a exists in a where you can filter the apply query per record of the main table so now you can get a filter before the grouping,tops, or window functions.