Re: sql issue

From: Kevin Gillins <k.gillins_at_verizon.net>
Date: Thu, 26 Sep 2002 11:52:21 -0400
Message-ID: <amvagb$fmj$1_at_nntp-m01.news.aol.com>


"yreddy" <yreddy00_at_hotmail.com> wrote in message news:4c9bbf24.0209251219.29dc577d_at_posting.google.com...
> I have a table with state , county and many more columns, i want to
> select 50 rows for every county in a state. This table has all the
> states and multiple counties per state. I am not worried about
> duplicate counties or anything. Just want the 50 records for every
> county in all the states
>
> thanks

Select

   t1.county,
   t2.many_more_columns
from

   your_table t1,
   (select many_more_columns
   from your_table
   where rownum <= 50) t2

This is a cartisian product. The only thing here is that the same 50 rows will be used from t2 for every row in t1.

Kevin Gillins Received on Thu Sep 26 2002 - 17:52:21 CEST

Original text of this message