Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Informix Topics / July 2008

Tip: Looking for answers? Try searching our database.

why does this query not work ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Floyd Wellershaus - 09 Jul 2008 17:49 GMT
Is there a reason this won't work  in IDS10 ?

select remote_addr, count(distinct query_id) count from web_l_sentrylog
group by remote_addr
having count(distinct query_id) > 5

I get an sql syntax 201 for the last line. If I were to remove the 'distinct' from the last line it would work, but it doesn't seem to like the having, together with the distinct ?

Thanks,
Floyd

Doug Lawry - 10 Jul 2008 14:53 GMT
It also doesn't work in IDS 11.10, and it doesn't make any difference
if the "count" column alias is replaced with a non-reserved word.

I suggest you report this as a bug. In the interim, you could use a
temporary table:

   select remote_addr, count(distinct query_id) number
   from web_l_sentrylog
   group by remote_addr
   into temp temp_table with no log;

   select *
   from temp_table
   where number > 5;

   drop table temp_table;

Regards,
Doug Lawry

> Is there a reason this won't work in IDS10 ?
>
[quoted text clipped - 8 lines]
> Thanks,
> Floyd
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.