[Info-Ingres] How to get number of returned rows of another select query?

tianfeichen at gmail.com tianfeichen at gmail.com
Sun May 20 06:59:34 CDT 2007


On May 20, 5:14 pm, "Roy Hann" <specia... at processed.almost.meat>
wrote:
> <tianfeic... at gmail.com> wrote in message
>
> news:1179629199.375579.195150 at u30g2000hsc.googlegroups.com...
>
> > On May 20, 11:35 am, tianfeic... at gmail.com wrote:
> > Yeah! I finally found the solution:
>
> >  select count (distinct (r1.rt_airline))
> >  from route r1
> >  where r1.rt_airline in
> > (select distinct r2.rt_airline
> > from route r2
> > where r2.rt_airline = r1.rt_airline)
>
> If that gives you what you want, what does this give you?
>
>     select count(distinct rt_airline) from route;


Oops you are right. I made simple thing more complex. It is my fault.
You already gave me a perfect answer in your first reply.

Those two looked-different but same-effect queries are from a program
I'm porting (from Java to .Net). My trivial excuse. :P

Thanks for your help. I learned a lot.



More information about the Info-Ingres mailing list