<body >

COUNT DISTINCT isn't supported

Monday, June 3, 2002

To get around it: SELECT COUNT(1) FROM (SELECT DISTINCT column FROM table)

Labels:

Read the article.

Permalink

Joins



When using multiple ANSI joins, you must surround each set in parentheses.

SELECT topic.name
FROM (users INNER JOIN messages ON users.id = messages.idUser)
INNER JOIN topics ON messages.idTopic = topics.id

Labels:

Permalink

Dates



Surround dates in SQL with #.

SELECT * FROM users WHERE joined > #3/4/2002#

Labels:

Permalink

Object Names



If there are queer characters or reserved words in your table/query names, you can reference them in SQL statements by surrounding the name with square brackets.

SELECT email, [date] FROM [List Members]
WHERE [date] > #3/4/2002#

Labels:

Permalink

Linked Tables in Access



If you find that you can open a linked table when you physically open the database, but not when you open it programmatically (via ASP, for example), upgrade the MDAC to the latest version.

Labels:

Permalink

 
   



Blogger Template by Gecko & Fly, modified by yours truly.