Category Archives: database administration
SQL Beautifier
I pulled a large amount of SQL out of some existing code and wanted to have it formated nicely for me. I figured there had to be some type of pretty printer for SQL available outside of applications like TOAD. I have access to TOAD but it would have required a reboot so I figured [...]
Fun with Oracle Strings
Today I needed to find a way to count the number of unique email domains in a table. I figured there was a way of getting the index of a string in another string and sure enough there is. This did the trick in Oracle:
SELECT count(1), SUBSTR(email, INSTR(email, '@', 1, 1)+1) FROM SOMETABLE GROUP BY [...]
How to get the next date for a weekday using Oracle