SQL Tricks

Post tags: | sql |
select CONVERT(CHAR(8), getdate(), 112)
select CONVERT(CHAR(8), READ_AT, 112),count(*)
        FROM extract.dbo.CVLAN_CALL_EVENTS
        group by CONVERT(CHAR(8), READ_AT, 112)
        order by CONVERT(CHAR(8), READ_AT, 112)

Drop foreign key constraints and recreate them

slideshow Markus Winand - Modern SQL in PostgreSQL

page Add LATERAL Joins or CROSS APPLY to Your SQL Tool Chain

page Dan Robinson - PostgreSQL’s Powerful New Join Type: LATERAL

page PostgreSQL 9.3 Lateral Part2: The Lateral Left Join