SQL

Some useful bits and pieces I've come across for using SQL, mostly the Teradata variant.

Using Teradata SQL: How to find all the tables in a database or user area

This SQL lets you find all the tables in a particular database or your user area (your personal database) in Teradata, or table names that match a pattern.

SQL
Jamie Whitehorn

Using Teradata SQL: Find the difference between two timestamps and express as hours

How to compare two timestamps in SQL and express the result in hours.

SQL
Jamie Whitehorn

Using Teradata SQL: How to find the number of AMPs and Nodes

How to find the number of AMPs and Nodes in a Teradata installation using a simple SQL query.

SQL
Jamie Whitehorn

Using Teradata SQL: How to drop (aka delete) a lot of tables at once

This SQL creates a series of commands that can be used to DROP (aka delete) all the TABLES that match a pattern or username.

SQL
Jamie Whitehorn

Using Teradata SQL: How to check if a table exists

Explains how to use SQL to check if a table already exists. Very useful to check prior to dropping a table, or for volatile tables if you re-run SQL.

SQL
Jamie Whitehorn

Using Teradata SQL: Validating a UK Postcode

This one came about because a set of data I was dealing with had UK postcodes in it. The data came in from a whole variety of sources, and a

SQL
Jamie Whitehorn

Using Teradata SQL: Create a table from another table or select statement

OK, this one is fairly basic for anyone who regularly uses SQL, but it's a neat trick if you're not familiar with it. Normally when you crea

SQL
Jamie Whitehorn

Using Teradata SQL: How to find the first or last record in a sequence

If your reading a lot of records from a database and you need to find the first or last record in a sequence, you can do this in MS SQL by u

SQL
Jamie Whitehorn