Problems with complicated SQL query results and one solution which solves them all | Dark Hacker News