Easily produce and use a table of numbers
A numbers table is a versatile tool that can be used to synthesize ranges of various kinds of data. For instance, you can write queries against a numbers table to identify gaps or breaks in…
A numbers table is a versatile tool that can be used to synthesize ranges of various kinds of data. For instance, you can write queries against a numbers table to identify gaps or breaks in…
Sometimes it’s useful to be able to generate an HTML table based on the data produced by a query. I’ve worked with clients who have needed this done as part of an internal automated notification…
Query result ordering is not guaranteed. If your query does not include an ORDER BY clause, the order of your results is completely arbitrary. This is because tables are sets, which themselves have no order.…
The first edition. Thanks for reading. 1. NULL Values in SQL Queries Handling NULL values in SQL is tricky to say the least. An interesting tour of ternary logic. 2. pg_ctl Tips and Tricks pg_ctl…
What if you need to create a temporary table, but you don’t want or need to create a table variable or temporary table? One option is to ‘synthesize’ a table using constants — also known…
If all you care about is the version alone, then all you need is… In my work, I find I also sometimes need to know more information about the underlying system. Which produces:
1. Create a new user defined table type (UDTT). A table type is conceptually like a temporary table, but you can pass this dude into a stored procedure as a parameter. This is handy if…
The following list of sites give users the chance to practice writing SQL through a series of progressive exercises. These are the sites I’ve found through initial research, but is not necessarily an exhaustive list.…
The SQL sandboxes listed here are a great way to practice your SQL skills and practice querying against a live database. The interactivity is the killer feature. The sits listed here present guided exercises along…