Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Why Does This Work? |
Thu, Feb 2 2006 6:56 AM | Permanent Link |
Stuart Kelly | Hi,
I have been looking at some old querys on a DBISAM 3.30 database. I was wondering why the following SQL works without a WHERE. Is WHERE not required? SELECT STAFF_ID, FIRST_NAME, SURNAME, SUM(TOTAL_PRICE - TOTAL_DISCOUNT_ALLOCATION) 'SALES', BRANCH_NAME, BRANCH_ID, TILL_ID FROM NORMALTRANLOG NTLOG INNER JOIN STAFF ON (STAFF.STAFF_ID = STAFF_ID) INNER JOIN BRANCH ON (BRANCH.BRANCH_ID = CAST(NTLOG.BRANCH_ID AS INTEGER)) AND DATE >= '2005-01-01' AND DATE <= '2006-01-01' GROUP BY STAFF_ID, BRANCH_ID, TILL_ID ORDER BY SURNAME ASC, FIRST_NAME ASC Thanks Stuart |
Thu, Feb 2 2006 8:06 AM | Permanent Link |
"Ralf Mimoun" | Stuart Kelly wrote:
> Hi, > > I have been looking at some old querys on a DBISAM 3.30 database. I > was wondering why the following SQL works without a WHERE. > > Is WHERE not required? No. Ralf |
Thu, Feb 2 2006 8:25 AM | Permanent Link |
Eryk Bottomley | Stuart,
> I have been looking at some old querys on a DBISAM 3.30 database. I was wondering why the > following SQL works without a WHERE. > > Is WHERE not required? It works because in SQL89 there was no JOIN keyword and joins therefore had to be expressed as WHERE conditions. In order to maintain backward compatibility with SQL89 while also supporting SQL92 most engines therefore lump both JOIN and WHERE conditions together for processing and as a side effect allow you to create (logically) badly formed expressions like the one you quoted. Eryk |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |