Ask the Expert
My SQL Articles at TechTarget.com
Added 2009-04-09
Between 2001 to 2009, I wrote an SQL column called Ask The Expert for TechTarget.com. It's currently located on SearchOracle.com (one of the TechTarget sites), but it's not about Oracle, it is "technology agnostic" and covers SQL of all flavours.
If you have a question about SQL, I can no longer answer it at SearchOracle.com, but if you contact me here on my site, I'll reply to you personally. I cannot promise to answer your question, but I will reply.
For your convenience, below are links to all 686 of my SQL "Ask The Expert" answers.
Caution: some links don't work. TechTarget seems to have gone through another of their url-rewriting cycles, and many of the following links no longer work properly. You won't see a 404 page, you'll just get redirected to some generic page.
Despair not. Just copy and paste the title of the answer into the SearchOracle search box. All the articles are still there.
- How to check SQL query construction with the Mimer Validator
9 April, 2009 - Using the SQL GROUP BY clause for counting combinations
9 April, 2009 - How to use an SQL CASE expression
9 April, 2009 - How to sort an SQL UNION query with special ORDER BY sequence
19 February, 2009 - How to use string functions to make an SQL join
19 February, 2009 - An SQL solution for a customer order homework problem
13 January, 2009 - How to use SQL's POSITION function with substrings
13 January, 2009 - Using SQL date functions to get totals for last three days
13 January, 2009 - Using CASE in the SQL ORDER BY clause
13 January, 2009 - What's the difference between an SQL inner join and equijoin?
5 December, 2008 - Using an SQL SELECT statement from a non-existing table
19 November, 2008 - Using the SQL date function to find aggregate totals by month
19 November, 2008 - How to return multiple values for THEN clause in an SQL CASE expression
10 November, 2008 - Should I try to avoid a LEFT OUTER JOIN in SQL?
10 November, 2008 - Can I concatenate row values in SQL?
10 November, 2008 - Using LEFT OUTER JOIN query to get zero row counts in SQL
10 November, 2008 - Tips for derived tables in SQL Server and using FULL OUTER JOINs
15 October, 2008 - How to write an SQL query for two foreign keys to the same table
15 October, 2008 - How to create an SQL CHECK constraint for two letters
15 October, 2008 - How to write an SQL query using GROUP BY for row analysis
10 September, 2008 - Using nested SQL string functions to find ERP customer values in a table
10 September, 2008 - How to return a zero in SQL instead of no row back for a select count
10 September, 2008 - CASE expressions in the ORDER BY clause
16 July, 2008 - The SQL REPLACE function
16 July, 2008 - SQL to select rows 1000 through 3000 in a table
16 July, 2008 - SQL query to combine rows
16 July, 2008 - Using BETWEEN with DATETIMEs in SQL
3 July, 2008 - Finding a column value inside a user-supplied string
3 July, 2008 - Update a specific column in a field or row?
3 July, 2008 - Which normal form is used most?
3 July, 2008 - SQL query for co-authored books
19 June, 2008 - Querying complex derived tables
19 June, 2008 - Connecting tables in a database
19 June, 2008 - IN list or series of OR conditions?
19 June, 2008 - SQL string functions
3 June, 2008 - Changing a NULL column to NOT NULL
3 June, 2008 - SQL for hourly totals for the last 48 hours
20 May, 2008 - LEFT OUTER JOIN to a MIN/MAX row
20 May, 2008 - Normalizing a crosstab table
20 May, 2008 - How do I retrieve second transaction for each customer?
17 April, 2008 - Correlated update in Oracle
17 April, 2008 - Querying metadata and data at the same time
17 April, 2008 - Entity-Attribute-Value constraints
4 April, 2008 - SQL to update the header records?
4 April, 2008 - A running total
4 April, 2008 - SQL to round up to nearest thousand
24 March, 2008 - CHECK constraints
24 March, 2008 - Collapsing a one-to-many result set
15 February, 2008 - Is this where we use a RIGHT OUTER JOIN?
15 February, 2008 - The last transaction date every month
15 February, 2008 - Return non-matching rows from both tables
25 January, 2008 - Running a Monday-Friday report to include weekend data
25 January, 2008 - Select from one table based on condition in another
25 January, 2008 - How to use DISTINCT on just one column
16 January, 2008 - How to update columns dynamically
16 January, 2008 - Extracting data from within a column
16 January, 2008 - Using SQL to get counts of counts
11 January, 2008 - Retrieving row numbers with SQL
11 January, 2008 - SQL to count values of a status code
21 December, 2007 - Counting NULL columns
21 December, 2007 - Detail rows for accounts that occur three times
21 December, 2007 - Summing quantities in gapless sequences
24 November, 2007 - Full name column from last name and first name
24 November, 2007 - Row numbers over partitions in SQL
22 October, 2007 - Aggregates for date periods
10 October, 2007 - What are the different date formats in SQL?
10 October, 2007 - Counting a row's NULL columns
8 October, 2007 - Three ways SQL can count rows by type
31 August, 2007 - Latest transaction if no recent prior transactions
31 August, 2007 - Oracle SQL to test for numerics
30 August, 2007 - SQL to select only certain times within a date range
30 August, 2007 - Stringing together columns with UPDATE SQL
24 August, 2007 - Number of rows in multiple tables
24 August, 2007 - Sargable predicates in SQL
13 August, 2007 - How can SQL test for pure numerics?
13 August, 2007 - Integrity constraints and referential integrity
1 August, 2007 - Generate a range of two-character codes
24 July, 2007 - Change the order of conditions in the WHERE clause
24 July, 2007 - Latest X for each Y in a many-to-many relationship
20 July, 2007 - Use HAVING with CASE to count specific instances
20 July, 2007 - SQL query for all Fridays in a year
17 July, 2007 - SQL for five days ago, excluding weekends
17 July, 2007 - Previous three months of data
13 July, 2007 - Should column names in UNION queries match?
13 July, 2007 - SQL FAQ: Common SQL questions, part 3
5 July, 2007 - SQL FAQ: Common SQL questions, part 2
5 July, 2007 - SQL FAQ: Common SQL questions, part 1
5 July, 2007 - SQL counts for separate related tables
12 June, 2007 - What is the meaning of ER model?
12 June, 2007 - What is the line feed character in SQL?
12 June, 2007 - SQL CHECK constraints to validate table inserts
7 June, 2007 - The MAX of two MAX values in SQL
7 June, 2007 - NOT EXISTS with a correlated subquery
31 May, 2007 - Obtaining COUNTs for males and females in one SQL query
31 May, 2007 - The ALTER TABLE statement
31 May, 2007 - The running total self-join
24 May, 2007 - Using GROUP BY to collapse rows
24 May, 2007 - Number of rows in two tables
24 May, 2007 - Matching one column value to part of another in SQL
24 May, 2007 - SQL to calculate days to next status change
18 May, 2007 - Does SUM discard rows that have 0 values?
18 May, 2007 - UPDATE only rows which match another table
18 May, 2007 - Employees with the same first and last names in SQL
11 May, 2007 - GROUP BY comment from a reader
11 May, 2007 - Two SQL homework questions
26 April, 2007 - Columns in the SELECT not in the GROUP BY
26 April, 2007 - All employees under a given manager
23 April, 2007 - Latest three payments for each account
13 April, 2007 - Analytic solution to counting rows in runs
13 April, 2007 - Distinct values of more than one column
5 April, 2007 - LEFT OUTER JOIN without using LEFT OUTER JOIN
5 April, 2007 - Difference between candidate key and composite key
5 April, 2007 - Highest revision within highest version
3 April, 2007 - Update two columns with one UPDATE command
3 April, 2007 - Counting rows in runs
29 March, 2007 - Inserting multiple rows in SQL
29 March, 2007 - Composite keys and normalization
22 March, 2007 - Add a column in a specific position in a table
22 March, 2007 - More about ORDER BY for a specified sequence
13 March, 2007 - Compare two tables for anomalies
8 March, 2007 - Convert minutes to HH:MM:SS format
8 March, 2007 - Totals from a UNION query
8 March, 2007 - Performance of IN lists
23 February, 2007 - Runs in groups
23 February, 2007 - Closest Saturday less than or equal to a date given
23 February, 2007 - First or third Monday of the month?
15 February, 2007 - When "grouped by" means ORDER BY
15 February, 2007 - Invalid GROUP BY queries
30 January, 2007 - Number of rows and columns
30 January, 2007 - Groups that have over 50% females
25 January, 2007 - Minimum value from several columns
25 January, 2007 - One column LIKE another column
17 January, 2007 - COUNT(*) or COUNT(1)
17 January, 2007 - Generating numbers with MAX(id)+1
17 January, 2007 - Normalizing a comma-delimited list
2 January, 2007 - Fiscal year in Oracle SQL
2 January, 2007 - GROUP BY multiple columns
2 January, 2007 - Searching for a value in 12 columns
2 January, 2007 - Sum of sales for two years, by month
18 December, 2006 - Optimizing a query
22 November, 2006 - Consecutive dates within a range
21 November, 2006 - Getting a COUNT(*) of the rows produced by a query
21 November, 2006 - Paging with multiple columns
30 October, 2006 - Finding the highest COUNT in a GROUP BY query
26 October, 2006 - Start dates, end dates and history tables
26 October, 2006 - The minimum column value in the row
19 October, 2006 - Fuzzy matching in SQL
19 October, 2006 - Maximum of 5-day running totals
16 October, 2006 - Foreign keys in a composite primary key
6 October, 2006 - Counting rows in a UNION query
6 October, 2006 - What is normalization?
29 September, 2006 - Combine multiple lines of text into one
29 September, 2006 - Preventing changes to the primary key
22 September, 2006 - All possible combinations of values
22 September, 2006 - Latest transaction before a specified date
15 September, 2006 - INFORMATION_SCHEMA primary key
15 September, 2006 - Searching for multiple words
15 September, 2006 - Sequence of execution of SELECT query clauses
8 September, 2006 - How to query a query
8 September, 2006 - The WITH clause
1 September, 2006 - DISTINCT applies to all columns in the result
1 September, 2006 - Two ways to SUM a complex expression
10 August, 2006 - GREATEST and LEAST
10 August, 2006 - Instant grouping!
4 August, 2006 - Pattern matching
4 August, 2006 - Aggregating time intervals
1 August, 2006 - How many Sundays in any month
14 July, 2006 - Identify column names by table names when using SELECT *
14 July, 2006 - Concatenate into a single row
28 June, 2006 - Date constraint in a query
28 June, 2006 - Count two columns in a join
28 June, 2006 - Tune this complex WHERE clause
28 June, 2006 - Update a substring of a column value
28 June, 2006 - Cumulative quantities
23 June, 2006 - Can a foreign key also be used as the primary key in the same table?
23 June, 2006 - Function is nested too deeply
23 June, 2006 - Different invoices on first and last version in group
23 June, 2006 - Counting separate PO numbers for a part
10 May, 2006 - Monday to Sunday weeks in Oracle
10 May, 2006 - Delete all but two rows in each group
4 May, 2006 - ON DELETE RESTRICT
4 May, 2006 - ORDER BY a specified sequence
21 April, 2006 - SQL statement gets very long very fast
21 April, 2006 - Using a pre-existing list
21 April, 2006 - Year-to-date period totals
13 April, 2006 - Deleting Parent and Child rows
13 April, 2006 - Complex query with DECODE
13 April, 2006 - EXISTS subquery or OUTER JOIN?
13 April, 2006 - Using DISTINCT with TEXT, NTEXT or IMAGE
13 March, 2006 - Counting matches in a self-join
7 March, 2006 - Primary key enforced by unique index
23 February, 2006 - Splitting columns into separate tables
23 February, 2006 - Dupes involving a compound key
8 February, 2006 - Nth Saturday of the month
3 February, 2006 - "Select star" with column reformatting in Oracle
3 February, 2006 - COUNT and MAX from unrelated tables
3 February, 2006 - Count consecutive years
25 January, 2006 - Copy a row to the same table
25 January, 2006 - "Select star" with column reformatting
25 January, 2006 - Select columns as rows
25 January, 2006 - List of last seven dates
17 January, 2006 - Display columns in rows
17 January, 2006 - Select empname and managername
17 January, 2006 - Unpredictable consecutive rows
6 January, 2006 - Limitation of IN clause in SQL
6 January, 2006 - The three smallest numbers
16 December, 2005 - COMMIT after deleting X records
16 December, 2005 - Sequence of WHERE and ORDER BY clauses
16 December, 2005 - More on using date as a primary key
5 December, 2005 - Should sequence numbers be used as primary keys?
2 December, 2005 - Percentages of overall total
2 December, 2005 - Select another row if first choice is not available
2 December, 2005 - Multiple rows with same value in one column
2 December, 2005 - Counting rows in a LEFT OUTER JOIN
28 November, 2005 - Difference between a primary key and a surrogate key
28 November, 2005 - Select only non-null columns
28 November, 2005 - The row with the Nth value in a column
28 November, 2005 - SQL ANSI standards
28 November, 2005 - Using date as a primary key
4 November, 2005 - Which is faster, subquery or join?
4 November, 2005 - DISTINCT with GROUP BY
28 October, 2005 - Match two words in a column
28 October, 2005 - DELETE WHERE NOT EXISTS
28 October, 2005 - WHERE EXISTS ( SELECT NULL... ) revisited
28 October, 2005 - ORDER BY ordinal position
21 October, 2005 - Accounts with same rows as a given account
21 October, 2005 - Return only one product per category
21 October, 2005 - Delete first row by date for each customer
21 October, 2005 - Populate a calendar table
13 October, 2005 - Another good FULL OUTER JOIN example
13 October, 2005 - Candidate keys
30 September, 2005 - The Nth row in a table
30 September, 2005 - The group with the greatest COUNT
30 September, 2005 - Retrieve data related by composite key
30 September, 2005 - DISTINCT is not a function
26 September, 2005 - Compare values in consecutive rows
26 September, 2005 - The row with the latest date
26 September, 2005 - Oracle treats empty strings as NULL
23 September, 2005 - Calculate amount percentages
23 September, 2005 - Foreign key referencing only part of composite primary key
23 September, 2005 - Query 2 should not include results from Query 1
19 September, 2005 - LEFT OUTER JOIN on more than two tables
19 September, 2005 - The difference between NOT IN and NOT EXISTS
16 September, 2005 - LEFT OUTER JOIN with ON condition or WHERE condition?
16 September, 2005 - LEFT and RIGHT joins, INNER and OUTER joins
1 September, 2005 - Joining on variable field names
1 September, 2005 - Top 3 counts, revisited
1 September, 2005 - NULL can be your friend
18 August, 2005 - Three consecutive months in fiscal year
17 August, 2005 - Ranking within a group
12 August, 2005 - Latest version of each jobcode
12 August, 2005 - Another FULL OUTER JOIN example
12 August, 2005 - Comparing current and previous row values
4 August, 2005 - COUNT DISTINCT revisited
4 August, 2005 - How to UNION tables that are not union-compatible
4 August, 2005 - Why I love VIEWs
25 July, 2005 - Integer or CHAR(1) primary key?
25 July, 2005 - Converting to LEFT OUTER JOIN syntax
15 July, 2005 - Generating week dates
15 July, 2005 - Top 3 counts querying two tables
27 June, 2005 - MAX and COUNT DISTINCT
27 June, 2005 - Counting multiple intersections
23 June, 2005 - Multiple distinct combinations
23 June, 2005 - Querying derived tables
2 June, 2005 - Must have all rows
2 June, 2005 - Move a row from one table to another
2 June, 2005 - UNION-compatible columns
19 May, 2005 - Nested functions
19 May, 2005 - Getting a count of zero for unmatched rows
19 May, 2005 - Compare last year sales to this year sales
6 May, 2005 - Join only latest row per user
6 May, 2005 - When not to use GROUP BY
6 May, 2005 - Personal, work, and preferred e-mail addresses
29 April, 2005 - Count the number of rows produced by a query
29 April, 2005 - Alternative to LEFT OUTER JOIN?
18 April, 2005 - Using a column alias
8 April, 2005 - A subquery with a different WHERE clause
6 April, 2005 - Recalculating row rank
6 April, 2005 - Stop and perform a task
6 April, 2005 - Top N rows for each X
21 March, 2005 - Durations calculated from two rows
21 March, 2005 - Customers who bought X at least once and Y at least twice
14 March, 2005 - Rows to columns (another "crosstab" report)
14 March, 2005 - Select all rows for a particular column
10 March, 2005 - Joining on a substring of a column
10 March, 2005 - Cross join effects
7 March, 2005 - NULLs propagate through expressions
7 March, 2005 - Sum of two table row counts as one answer
7 March, 2005 - Totals for one customer compared with totals for all
2 March, 2005 - When did a product price increase a given percentage
25 February, 2005 - SUMs from either of two columns
25 February, 2005 - Number of values across a row
22 February, 2005 - Multiple rows from multiple columns
22 February, 2005 - Another WHERE EXISTS example
22 February, 2005 - Concatenate values into comma-delimited string
14 February, 2005 - Difference between WHERE and HAVING
14 February, 2005 - Paging through SQL query results
14 February, 2005 - Removing duplicate rows
9 February, 2005 - Leading zeros
9 February, 2005 - Column name in a combo box
9 February, 2005 - Updating a local table from company tables
31 January, 2005 - Delete from table A if matching row exists in B
31 January, 2005 - TOP query with multiple columns
13 January, 2005 - Split a column value based on numeric character
13 January, 2005 - ISO/ANSI SQL and the GROUP BY clause
10 January, 2005 - Runs of sequential numbers, part 2
22 December, 2004 - Runs of sequential numbers, part 1
22 December, 2004 - Nested selects
10 December, 2004 - Joining derived tables
10 December, 2004 - Cumulative sum across the row, not down the column
29 November, 2004 - Mixing ORs with NOTs
29 November, 2004 - The last N rows in each group
24 November, 2004 - Counting days per month in a date range, part 2 of 2
19 November, 2004 - Counting days per month in a date range, part 1 of 2
19 November, 2004 - Joining two many-to-many relationship tables
19 November, 2004 - NULL columns in a LEFT OUTER JOIN
19 November, 2004 - Generate N rows for a column value of N
12 November, 2004 - Extract surname from name column
12 November, 2004 - Sum elapsed hours by task by date, part 3 of 3
9 November, 2004 - Sum elapsed hours by task by date, part 2 of 3
9 November, 2004 - Sum elapsed hours by task by date, part 1 of 3
9 November, 2004 - Only the latest matching row
13 October, 2004 - Cursor or application code?
13 October, 2004 - Duplicate company names
13 October, 2004 - Clarity in stating the question
13 October, 2004 - Candidate keys
7 October, 2004 - Assertions
7 October, 2004 - Foreign keys
24 September, 2004 - NOT EXISTS correlated subquery, or OUTER JOIN?
20 September, 2004 - N consecutive rows, Part 4 of 4
10 September, 2004 - N consecutive rows, Part 3 of 4
10 September, 2004 - N consecutive rows, Part 2 of 4
10 September, 2004 - N consecutive rows, Part 1 of 4
10 September, 2004 - Integer or character primary key
30 August, 2004 - Counts from two tables in one SQL statement
13 August, 2004 - Use CASE to translate a value to a string
13 August, 2004 - A sweet theta join
9 August, 2004 - Counting rows by month name
9 August, 2004 - The current anniversary year (part 2)
4 August, 2004 - The current anniversary year (part 1)
4 August, 2004 - Using a derived table instead of a view
12 July, 2004 - Groups having only one value in a column
12 July, 2004 - Sorting by day name
28 June, 2004 - Composite keys in M:N relationship tables
28 June, 2004 - The "next" composite primary key
21 June, 2004 - Having all values in a list
21 June, 2004 - TOP n WITH TIES in MySQL
3 June, 2004 - Inserting and searching many-to-many relationships
3 June, 2004 - Differences between two tables
25 May, 2004 - Special sort order in a UNION query
25 May, 2004 - Two "copies" of a lookup table in the same query
17 May, 2004 - Highest value in each row
17 May, 2004 - Top ten sales for each salesman
17 May, 2004 - Counting rows in a subtree
23 April, 2004 - Grouping by a column that isn't there
23 April, 2004 - The surrogate key of the row just inserted
22 April, 2004 - Optional foreign key can be NULL
8 April, 2004 - The effect of normalization on query simplicity
2 April, 2004 - Top two in each group in MySQL
2 April, 2004 - A scalar subquery
22 March, 2004 - First and last date of the current month
12 March, 2004 - What is a correlated subquery?
12 March, 2004 - Counting only some rows in a GROUP BY
12 March, 2004 - Why "select star" is bad
9 March, 2004 - Gaps in autonumber sequences
9 March, 2004 - Special categories
13 February, 2004 - Counts and total count in one query
13 February, 2004 - Top N distinct
13 February, 2004 - Combining unrelated queries
10 February, 2004 - Padding with zeroes
10 February, 2004 - Three consecutive days
10 February, 2004 - Gaps in sequences
9 February, 2004 - Scalar subselects
9 February, 2004 - Customers with orders for the last N years
9 February, 2004 - Totals by yearly quarters
2 February, 2004 - Two foreign keys to the same primary key?
2 February, 2004 - The integers table
28 January, 2004 - Supertypes and subtypes
28 January, 2004 - Compare two many-to-many relationships, Part 2
28 January, 2004 - Compare two many-to-many relationships, Part 1
28 January, 2004 - Cumulative sums within groups
12 January, 2004 - Calculations between two rows in one table
12 January, 2004 - Users not in a specific group
12 January, 2004 - Transitive joins
12 January, 2004 - Can one group LIKEs together?
22 December, 2003 - Dates in the past month
22 December, 2003 - One column contained in another
22 December, 2003 - Latest two rows for each group
17 December, 2003 - Latest row for each group
17 December, 2003 - Only one distinct value in a group
2 December, 2003 - Current and History transactions
2 December, 2003 - Users, groups, and folders
2 December, 2003 - SELECT/INTO and INSERT/SELECT
1 December, 2003 - A business rule for no childless parent rows
21 November, 2003 - UPDATE one table based on a condition in another
21 November, 2003 - Search in four separate tables
4 November, 2003 - Crosstab totals by month
4 November, 2003 - Booleans in SQL Server
27 October, 2003 - A "crosstab" query
27 October, 2003 - Derived table in DB2
27 October, 2003 - Quotes in SQL
20 October, 2003 - Subquery or join?
20 October, 2003 - Recursion in SQL
20 October, 2003 - Using OR instead of UNION in a subselect
20 October, 2003 - Top N subcategories, Part 4
13 October, 2003 - Top N subcategories, Part 3
3 October, 2003 - Top N subcategories, Part 2
3 October, 2003 - Top N subcategories
3 October, 2003 - Converting columns to rows
26 September, 2003 - ON DELETE and ON UPDATE on same table
26 September, 2003 - Three ways to query a table relationship
12 September, 2003 - Combining a LEFT OUTER and INNER join
12 September, 2003 - Syntax differences in MS Access
12 September, 2003 - Summing values in discrete ranges
11 September, 2003 - UNION in a subquery
11 September, 2003 - Extracting leading numeric digits from a field
10 September, 2003 - A view for a MAX value in any month
10 September, 2003 - Foreign key must reference a unique key
4 September, 2003 - The Sybase list() aggregate function
4 September, 2003 - One table or two tables with a join?
4 September, 2003 - Creating DDL to drop tables
4 September, 2003 - Complicated categories
22 August, 2003 - Nested GROUP Bys
22 August, 2003 - How to do looping in SQL
11 August, 2003 - SQL for a fixed width flat file
8 August, 2003 - COUNT DISTINCT in two different columns
8 August, 2003 - Consolidate data on multiple rows into one
1 August, 2003 - Changing a subquery into a JOIN
1 August, 2003 - NOT IN subselect with a compound primary key
23 July, 2003 - Calculating a percentage for a group
15 July, 2003 - Outer join with a condition
3 July, 2003 - Using a lookup table for a form select list
3 July, 2003 - ON DELETE SET NULL for lookup tables
30 May, 2003 - Can a table have two primary keys?
30 May, 2003 - Row calculations using a derived table
30 May, 2003 - Optimizing a COUNT query
30 May, 2003 - ON DELETE in a many-to-many relationship
20 May, 2003 - Counts from two different tables in one query
14 May, 2003 - Performing INSERT calculations
14 May, 2003 - Format query output as header and detail lines
14 May, 2003 - NULL OR TRUE evaluates as TRUE
28 April, 2003 - ANDs and ORs and NULLs in MySQL
23 April, 2003 - A "one-to-every" relationship
18 April, 2003 - COUNT DISTINCT in VB and Access
18 April, 2003 - Rows with consecutive dates
11 April, 2003 - Selecting all months even if they're missing
11 April, 2003 - The "any" option in dynamic search SQL, Part 2
8 April, 2003 - The "any" option in dynamic search SQL, Part 1
8 April, 2003 - Date arithmetic on a CHAR date in DB2
1 April, 2003 - Detecting a numeric value in a character column
28 March, 2003 - Calculate an end date from a start date
27 March, 2003 - When to use a cursor
27 March, 2003 - An OUTER JOIN using data that doesn't exist
27 March, 2003 - Select three columns and insert four
21 March, 2003 - Select only the second of duplicates
21 March, 2003 - Count males and females as well as total
14 March, 2003 - A list of IDs in a column
14 March, 2003 - Group aggregates as fractions of overall aggregate
24 February, 2003 - Alphanumeric primary key
24 February, 2003 - The recursive relationship
21 February, 2003 - OUTER JOIN instead of a NOT EXISTS subquery
21 February, 2003 - Calculating weeks between two dates
18 February, 2003 - How to validate zip code, city, and state code
18 February, 2003 - Orphan composite foreign keys
17 February, 2003 - Full outer join in a many-to-many relationship, part 2
17 February, 2003 - Full outer join in a many-to-many relationship, part 1
17 February, 2003 - Searching with multiple keywords
29 January, 2003 - How to retrieve a DB2 date in Julian format
29 January, 2003 - Are hyphens allowed in standard SQL column names?
29 January, 2003 - Preventing duplicate entries on multiple columns
20 January, 2003 - Comparing two tables
20 January, 2003 - Summing across columns
17 January, 2003 - Nested tables in MySQL
17 January, 2003 - One query to return disjoint sets (MySQL)
17 January, 2003 - Find duplicate sets of child rows
17 January, 2003 - Basic three-table join with a condition
17 January, 2003 - Boolean columns
2 December, 2002 - Maximum value in many-to-many relationships
2 December, 2002 - Selecting time portion of datetime columns
2 December, 2002 - Ensuring unique primary keys
2 December, 2002 - Conditionally summing fields
25 November, 2002 - Aggregates by day of week
25 November, 2002 - Selecting data between certain hours
25 November, 2002 - Latest contract period for each employee
25 November, 2002 - FIRST N rows, TOP N rows, LAST N rows, BOTTOM N rows...
25 November, 2002 - Rows having maximum group value in MySQL
15 November, 2002 - Check the bits of a numeric field
15 November, 2002 - Concatenating all columns generically
15 November, 2002 - DELETE or UPDATE, CASCADE or RESTRICT, part 2
11 November, 2002 - DELETE or UPDATE, CASCADE or RESTRICT, part 1
11 November, 2002 - Age constraint on a date column
11 November, 2002 - Why WHERE cannot be used after GROUP BY
11 November, 2002 - Day of the week
11 November, 2002 - COALESCE on three columns
11 November, 2002 - How to pronounce SQL
11 November, 2002 - Averages over a span of years -- Part 2
11 November, 2002 - Averages over a span of years -- Part 1
11 November, 2002 - Normalize a column containing a list
11 November, 2002 - Crosstab totals per quarter
11 November, 2002 - Sorting an E-mail column on Domain name
11 November, 2002 - Many-to-many links that aren't there
24 October, 2002 - Grouping output by week
24 October, 2002 - Inserting multiple child rows
24 October, 2002 - Paging through a result set without TOP or LIMIT
24 October, 2002 - Purpose of a primary key
17 October, 2002 - What does SELECT 1 accomplish?
17 October, 2002 - Exactly one row? At least one row? (Part 2)
17 October, 2002 - Exactly one row? At least one row? (Part 1)
17 October, 2002 - Grouping on the date part of a datetime column
17 October, 2002 - Column names in a UNION
4 October, 2002 - Aggregates for date ranges
4 October, 2002 - Aggregate functions in a left outer join
3 October, 2002 - Last N rows in DB2
3 October, 2002 - Creating an autonumber in Access using DDL
3 October, 2002 - INSERT using values from another table
2 October, 2002 - DELETE using values from another table
2 October, 2002 - Extracting a substring from a variable position in a string
2 October, 2002 - Closest date before or after a given date
2 October, 2002 - TOP 2 results in just one query
2 October, 2002 - Selecting every 100th of 1,000,000 rows
20 September, 2002 - Last day of the month
20 September, 2002 - Using CASE to change SELECT column values
20 September, 2002 - Composite foreign keys, Part 2
13 September, 2002 - Composite foreign keys, Part 1
13 September, 2002 - Clustered and non-clustered indexes again
13 September, 2002 - A one-to-many relationship as a comma-delimited list
6 September, 2002 - Mixing ANDs and ORs
6 September, 2002 - Multiple unique NULLs, revisited
6 September, 2002 - Substring function
6 September, 2002 - Books and authors, many-to-many
7 August, 2002 - Selecting specific DATETIME values
7 August, 2002 - Oracle SQL functions, not PL/SQL
7 August, 2002 - A "simple" crosstab problem
7 August, 2002 - DELETE WHERE NOT EXISTS
7 August, 2002 - Date last updated on a database-driven Web page
7 August, 2002 - How can I do a full outer join?
7 August, 2002 - Paging backwards through result sets
26 July, 2002 - Updating related information
26 July, 2002 - Moving autonumbers across databases
16 July, 2002 - Paging through a result set with SQL
16 July, 2002 - Result set row count along with query results
16 July, 2002 - AVG() function on a date field
12 July, 2002 - Cumulative sum in Access
12 July, 2002 - Another variation of the Top Ten query
8 July, 2002 - Select most recent with a condition
8 July, 2002 - Can you sum one field in a list of fields?
24 June, 2002 - Oracle and Sybase outer joins
24 June, 2002 - Date calculation in MS Access
24 June, 2002 - ANDs or ORs in a multi-field search
21 June, 2002 - Inserting a row in a particular place
21 June, 2002 - Concatenating a string to a number
21 June, 2002 - Grouping rows by 5-30 days, 31-60 days, and 61-90 days
21 June, 2002 - Clients with and without most recent order date
18 June, 2002 - Maximum number of columns in a primary key
18 June, 2002 - Keyword search a memo field in an Access database
10 June, 2002 - Finding all the dates between two dates
10 June, 2002 - Using generated numbers for primary keys
10 June, 2002 - Using generated numbers for primary keys, part 2
10 June, 2002 - Sorting substrings of different lengths numerically
5 June, 2002 - Sorting substrings of different lengths numerically, part 2
5 June, 2002 - Selecting from several tables
5 June, 2002 - Available rooms query for room reservation system
5 June, 2002 - NULL logic
5 June, 2002 - Trying to find the SQL92 and SQL99 specifications online
5 June, 2002 - Row number in a SELECT statement
24 May, 2002 - More than two tables in an OUTER JOIN
24 May, 2002 - Finding the next customer alphabetically
17 May, 2002 - Active and inactive records
17 May, 2002 - Subquery to find at least one
17 May, 2002 - Inserting values which contain a quote character
10 May, 2002 - Analysis of intersection frequency
10 May, 2002 - Sorting rows by a MMDDYY string
10 May, 2002 - Customers who made an account deposit every week
10 May, 2002 - Populating only some columns in a table
3 May, 2002 - Updating one table from another
3 May, 2002 - Retrieving last row inserted
24 April, 2002 - Performing a NOT IN without a subquery
24 April, 2002 - SUM() and MAX() at the same time
24 April, 2002 - Checking for duplicates before doing an INSERT
24 April, 2002 - Changing an ID field from numeric to character
16 April, 2002 - More on ISBN as a primary key
16 April, 2002 - More on composite primary keys
16 April, 2002 - Displaying numeric data as character
16 April, 2002 - GROUP BY and ORDER BY
16 April, 2002 - Select 3rd, 4th, 5th of 100 rows
10 April, 2002 - Selecting from two Access databases
10 April, 2002 - Time and date calculations
5 April, 2002 - Questions about primary keys
5 April, 2002 - Dates in Microsoft Access
5 April, 2002 - Birthdays in the next two weeks
28 March, 2002 - Validating a pair of columns with range tests
28 March, 2002 - Generating rows with default values
28 March, 2002 - Creating multiple rows from a group of columns
28 March, 2002 - Predicting query performance on larger data sets
21 March, 2002 - Multiple conditions in a group
21 March, 2002 - Selecting the latest order for a customer
15 March, 2002 - Populating one name column from three
15 March, 2002 - Copying an entire table to another table
15 March, 2002 - Sorting the days of the week with Monday first
15 March, 2002 - A Master/Detail report using SQL
15 March, 2002 - Selecting fractions of a penny
15 March, 2002 - Are COUNT and DISTINCT SQL-92 compliant?
15 March, 2002 - Crosstab sales by year
15 March, 2002 - Invoice amounts in a Crystal report
15 March, 2002 - Extracting the highest record in a group
7 March, 2002 - Need help to develop queries
7 March, 2002 - Efficient selection of "all" rows
7 March, 2002 - Need help to learn SQL
7 March, 2002 - Converting a character column containing dates to a DATE column in Oracle
27 February, 2002 - What is a primary key? Composite PK? Foreign key? Tuple?
27 February, 2002 - Using ISNULL or NULLIF to prevent division by zero
27 February, 2002 - How does WHERE EXISTS ( SELECT NULL... ) work?
22 February, 2002 - What is SQL?
22 February, 2002 - Joining tables based on partial matches
22 February, 2002 - Maximum number of rows in Microsoft Access
22 February, 2002 - Reverse order
13 February, 2002 - Returning records where column has carriage return line feed
13 February, 2002 - Nth maximum record in Sybase
13 February, 2002 - Three-way join
13 February, 2002 - Result of query more than one row
7 February, 2002 - Splitting one column into several
7 February, 2002 - Is an IN-list faster than OR predicates?
7 February, 2002 - Joining elements from several rows into one column
7 February, 2002 - Different query results with an additional SELECT column
7 February, 2002 - Comparing a MAX() value to another table
7 February, 2002 - Checking a referred e-mail against two tables
30 January, 2002 - Increasing the width of a column
30 January, 2002 - Consolidating sums from two GROUP BYs
30 January, 2002 - Inserting DB2 dates into COBOL variables
30 January, 2002 - Joining a table to one of two other tables
18 January, 2002 - Converting numbers to words
18 January, 2002 - Latest updated time value per group of rows
18 January, 2002 - Row sums and the "totals" row
28 November, 2001 - Key factors for successful SQL
16 November, 2001 - This year's versus last year's sales, Part II
5 November, 2001 - This year's versus last year's sales, Part I
3 November, 2001 - Reporting duplicate names with non-null addresses
30 October, 2001 - Stripping the first three characters off a column
25 September, 2001 - Comparing one set of rows with another
21 September, 2001 - Referencing rows by row number
8 September, 2001 - Combining invoice records
1 September, 2001 - Extracting a part number from a text field
31 August, 2001 - Concatenating a literal in Microsoft Access
25 July, 2001 - Subselect from DUAL not giving an error
25 July, 2001 - Table-driven deletes and updates
16 July, 2001 - Show the first three records of my table
16 July, 2001 - Top 5 salaried employees, not using TOP
13 July, 2001 - Running number in query results
13 July, 2001 - Latest date/time before current date/time
20 June, 2001 - Generating an ascii delimited file
20 June, 2001 - What does this theta self-join mean?
20 June, 2001 - Table join sequence for performance
16 June, 2001 - Denormalizing a result set
11 June, 2001 - Conditional values in the SELECT list
5 June, 2001 - Outer join syntax
1 June, 2001 - Items with sales above $10,000.00
31 May, 2001 - An Accounts Receivable report in one query
30 May, 2001 - Selecting random rows
29 May, 2001 - How can I use INSERT INTO to copy an entire table into another?
23 May, 2001 - Wrong answer for MOD function?
23 May, 2001 - Difference between two dates using office hours
22 May, 2001 - Returning a specified number of rows
22 May, 2001 - Apostrophes in input
21 May, 2001 - Table differences
21 May, 2001 - Difference between clustered and non-clustered indexes
16 May, 2001 - What does null mean?
13 May, 2001 - Is there a SQL-specific way to control record locking?
10 May, 2001 - Can I use a subselect statement?
3 May, 2001 - Supporting domains and SQL92 or SQL3 compatible servers
30 April, 2001 - How to return rows that show names with apostrophes
29 April, 2001 - Converting a database to any ODBC-compliant database
26 April, 2001 - Is the following correct?
26 April, 2001 - Joining two tables but including the most recent row for each
26 April, 2001 - How to find the first 5 highest salaried employees in each department
25 April, 2001 - Writing an SQL query that shows suppliers of only best shops in specific state
24 April, 2001 - Does the lack of domains hurt SQL?
23 April, 2001 - What does the decode function do, and how is it structured?
18 April, 2001 - How to get the maximum value for a row
18 April, 2001 - Adding a variable to a SQL statement
11 April, 2001 - Creating a weekly report by specifying a query between two dates
11 April, 2001 - Changing a 4-digit number into 3 digits
3 April, 2001 - Line returning no errors nor records when it should
3 April, 2001 - Rewriting a SQL Server select statement to work with Access
3 April, 2001 - Update registration information on two databases at different physical locations
3 April, 2001 - How to select the highest grade from list of names and ID's
26 March, 2001 - Insert data into empty table
20 March, 2001