3 ms·
select [select] from [from] where [where] = [equals] ?
by NoMoreNicksLeft 3y ago
select [select] from [from] where [where] = [equals]
?
- c0nfused 3y agoThis is the way. INSERT INTO [FROM] ([SELECT], [WHERE], [EQUALS]) VALUES( 'WHY YES', 'IT DOES', 'WORK')
- vidarh 3y agoThis is how you get maintenance developers to take out hits on you.
- codetrotter 3y agoBonus points if the tables contain highly abstracted data, so that there is no obvious name you could rename the tables and their columns either.
- mirages 3y agoHere is my try : WITH [WITH] AS ( SELECT [AS], [IN], [ON] FROM [UNION] WHERE [AND] = [OR] ), [OUTER] AS ( SELECT [LEFT], [RIGHT], [FULL] FROM [CROSS] WHERE [INNER] = [OUTER] ), [GROUP] AS ( SELECT COUNT(*) AS [HAVING] FROM [ORDER] GROUP BY [GROUP] HAVING COUNT(*) > 1 ) SELECT [WITH].[AS], [OUTER].[LEFT], [GROUP].[HAVING] FROM [WITH] JOIN [OUTER] ON [WITH].[IN] = [OUTER].[RIGHT] LEFT JOIN [GROUP] ON [WITH].[ON] = [GROUP].[HAVING] WHERE [WITH].[AS] = [OUTER].[LEFT] AND ([GROUP].[HAVING] IS NULL OR [GROUP].[HAVING] > 1) ORDER BY [WITH].[AS] ASC;
- NoMoreNicksLeft 3y agoI shouldn't even try. I'm clearly way out of my league here. Have an updoot.
- ljm 3y agoThat’s actually pretty clean in terms of being self documenting.