SQL Tip of the Moment

This page is an archive of articles previously hosted on the domain sql-guru.com from 2001 to 2002. A basic introduction to SQL can be found here.

Some of these articles have been translated into Czech by Ondrej Jurecek.

Archive

February 2002

Comparing each year with the previous year

January 2002

Putting more conditions in the join

December 2001

More than 10 records in the TOP 10

Returning Aggregate Data in the Same Recordset as Individual Records

Finding the very next record

October 2001

Getting the last n records

September 2001

Use UPDATE triggers to maintain data integrity

Current Status

Adding Columns To A Table

August 2001

Finding Out Whether a Table Exists

Fixing A Badly Designed Database Part 2

Fixing A Badly Designed Database

Prevent Overlapping Times

Buddies

July 2001

Hierarchies Part 3

Hierarchies Part 2

The Other Way of Generating Test Data

Getting Rows In Random Order

June 2001

Self Joins Part 1

Datetime Values Sometimes Include a Time

Searching for approximate matches (and getting exact matches first)

Sequences, Gaps, And Unique ID's

May 20001

Aggregate Functions Accross Multiple Tables

Write SQL that writes SQL

Unique Identity Values Across Multiple Tables

More Fun With ORDER BY

Fun With ORDER BY

April 2001

Enumerating Duplicates

Subqueries Aren't So Bad After All

Finding And Deleting Duplicates

Uses for UNION Queries #1

March 2001

Simplify Those Nested Joins

UNION Queries

Summarizing Data Over Arbitrary Time Frames

February 2001

Quotation Marks in Generated SQL

Joining on No Fields at All

Joining on Multiple Fields

Old Style Joins

 

Home About the Author Copyright © 2002 Adelle Hartley