Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Is this SQL Possible??

RE: Is this SQL Possible??

From: Grant Allen <Grant.Allen_at_towersoft.com.au>
Date: Tue, 21 Dec 2004 09:57:07 +1100
Message-ID: <DCFC52557FAC7640A8782B13032B81B0BC769A@bishopsfinger.towersoft.canberra>


Hi Ben,

I haven't seen anyone mention this, so I'll throw it in to the mix. One = of the OLAP options that's been around since 8i is SAMPLE, which does = almost exactly what you want. The only gotcha is you can specify = percentage of table, or blocks, to randomly grab ... not number of rows. =  You could play around to see if a ridiculously low percentage always = returns one row (the lower bound is .000001%).

Ciao
Fuzzy
:-)



"Everything you think, do, and say
 was in the pill you took today."
"Everything you think, do, and say
 was in the pill you took today."

> -----Original Message-----
> From: oracle-l-bounce_at_freelists.org
> [mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Ben Sauer
> Sent: Tuesday, 21 December 2004 06:11
> To: Oracle-l_at_freelists.org
> Subject: Is this SQL Possible??

>=20
>=20

> I have a many to one relationship from table b to table a. =20
> In other words,
> in
> table A I have people and in table B I have assignments. I=20
> need to write a
> query to pick up a set of users in table A and just one of=20
> their assignments.
> I
> don't even care which one. Is there a way to do that elegantly?
> =20
> I thought this would work... but it's just too time consuming.
> =20
> SELECT *
> FROM ss,
> (SELECT "Support Staff ID", "Group ID"
> FROM gd WHERE "Full Name" IN (SELECT DISTINCT "Full Name"
> FROM gd))
> WHERE ss.code =3D "Support Staff ID"
> Thanks,
> Ben.
>=20

> --------------------------------------------------------------
> ----------------
> This message may contain confidential information, and is
> intended only for the use of the individual(s) to whom it
> is addressed.
> --------------------------------------------------------------
> ----------------
>=20
>=20

> --
> http://www.freelists.org/webpage/oracle-l
>=20
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Dec 20 2004 - 16:59:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US