ANSI Standards – Database – Substring

Background Reviewing some SQL and wanted to point out a tiny dissimilarity between database platforms. Data Our test table is Oracle's SCOTT.EMP Here is what the data looks like :- Substring/Substr The HIREDATE is the only well formatted fixed length string. Its format is DD-MMM-YY. Query Oracle SQL Output Explanation Oracle relies on Substr to … Continue reading ANSI Standards – Database – Substring

Oracle :- Numbers Table

Background Let us create and populate a numbers table. Code Outline Creating a numbers table is a bit more complicated. And, it's complexity is dependent on Version of Oracle. Steps Create Table Identity Column To me identity column is a bit easier that Sequence Run Statement N Times In Transact SQL, we use go In … Continue reading Oracle :- Numbers Table

Oracle – Top N Records

Background This last week, Mr. P and I were talking shop as to how difficult it can be to return "Top N Records" from a Query. In SQL Server, it is not that difficult we simply use select top N. For more difficult scenarios where grouping is needed, we use Windowing Functions.   Oracle He … Continue reading Oracle – Top N Records