using DISTINCT or sub_queries

  • Thread starter Thread starter rbutch
  • Start date Start date
R

rbutch

Guys, in ASP.NET interfacing to oracle, are there limitations on using SQL and group functions?
or even subqueries for that matter?
i've tried this several ways, and even just tried using a SQL DISTINCT
and i get a "missing expression" error
correlated subqueries gets a "missing select" error
ive also tried this as a equijoin, but column aliases give this fits.


select count(DISTINCT empl_id),balance_date
from daily_interval
where empl_id IN(select empl_id from empl_profile where org_lvl_3='AT' and org_lvl_4='41940200')
and balance_date >='24 DEC 04'
group by balance_date


i know i could rely on the count property, but i do need to return a DISTINCT value for the empl_id variable based on the balance_date.

again, this is an ASP.NET app using Oracle back end.
i really dont want to have to rely on a ref cursor to do a really simple select & group functions
thanks
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
never mind, i figured it out using parenthesis to eliminate ambiguity

select (count (DISTINCT(d.empl_id)))

in toad or sql+ it isnt that strict.
thanks
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Back
Top