Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Difficult query problem
Michel Cadot wrote:
> "DFS" <nospam_at_dfs_.com> a écrit dans le message de news: > C5nBg.15880$WM.13984_at_bignews1.bellsouth.net... >> Michel Cadot wrote:
>> >> Very nice! I like how it displays which conditions the row meets. >> >> For conditions 1 and 2 it gives the correct rowcounts (206 and 259 >> respectively), but not for condition 3 (it returns 127 rows but >> should bring back 177). Example: it returns only one row for >> BLDG130 on 10-NOV-05, but 3 visits were made to that building on >> that day. > > Yes but aming these 3 visits, 2 were with visitcode 'V9' and meet > condition 2 > and so are eliminated according to your VB algorithm: > "marking the rows that met conditions 1 or 2, then > looking for ***those that met neither or both conditions 1 and 2 (and > marked > those as condition3)***"
My VB algorithm didn't eliminate them - it also marked them as condition 3.
I updated your initial response:
replace "and cntcode <= 1 and cntemp <= 1" with "and cntcode >= 1 and cntemp >= 1"
and I get 177 rows. Cool. Great query!
I do most of my querying in Access (ODBC links to Oracle tables), but I could create this one as a view or pass-thru.
Thanks Michael. Received on Sun Aug 06 2006 - 11:57:59 CDT
![]() |
![]() |