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: SQL question

RE: SQL question

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Mon, 23 Sep 2002 10:33:35 -0800
Message-ID: <F001.004D6DFF.20020923103335@fatcity.com>


Content-Type: multipart/alternative;
 boundary="----_=_NextPart_001_01C26327.0A213CE0" ------_=_NextPart_001_01C26327.0A213CE0
Content-Type: text/plain;
 charset="iso-8859-1"

Steve,

select 'select a.code ' || chr(10) || ' from(' || from dual
union
select distinct 'select ' || '''' || code || '''' || ' code from dual ' || chr(10) || 'union' ||
  from my_code_table
union
select ')' || chr(10) || 'minus' from dual /
select 'select distinct code from my_table' || chr(10) || '/' /

drop off the last union before the closing parenthesis ...

See ... now you don't have to type ...

Raj



Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art!

-----Original Message-----
Sent: Monday, September 23, 2002 1:38 PM To: Multiple recipients of list ORACLE-L

Dan (and Charlie),

Thanks.
Good suggestions, but the IN clause contains just over 1700 values.

Puzzling, huh?

steve

------_=_NextPart_001_01C26327.0A213CE0
Content-Type: text/html;
 charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: SQL question</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Steve,</FONT>
</P>

<P><FONT SIZE=2>select 'select a.code ' || chr(10) || ' from(' ||</FONT>
<BR><FONT SIZE=2>from dual</FONT>
<BR><FONT SIZE=2>union</FONT>
<BR><FONT SIZE=2>select distinct 'select ' || '''' || code || '''' || ' code from dual ' || chr(10) || 'union' ||</FONT>
<BR><FONT SIZE=2>&nbsp; from my_code_table </FONT>
<BR><FONT SIZE=2>union</FONT>
<BR><FONT SIZE=2>select ')' || chr(10) || 'minus' from dual</FONT>
<BR><FONT SIZE=2>/</FONT>
<BR><FONT SIZE=2>select 'select distinct code from my_table' || chr(10) || '/'</FONT>
<BR><FONT SIZE=2>/</FONT>
</P>
<BR>

<P><FONT SIZE=2>drop off the last union before the closing parenthesis ...</FONT>
</P>

<P><FONT SIZE=2>See ... now you don't have to type ...</FONT>
</P>

<P><FONT SIZE=2>Raj</FONT>
<BR><FONT SIZE=2>______________________________________________________</FONT>
<BR><FONT SIZE=2>Rajendra Jamadagni&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MIS, ESPN Inc.</FONT>
<BR><FONT SIZE=2>Rajendra dot Jamadagni at ESPN dot com</FONT>
<BR><FONT SIZE=2>Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. </FONT>
<BR><FONT SIZE=2>QOTD: Any clod can have facts, but having an opinion is an art!</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Steven Haas [<A HREF="mailto:steven.haas_at_snet.net">mailto:steven.haas_at_snet.net</A>]</FONT>
<BR><FONT SIZE=2>Sent: Monday, September 23, 2002 1:38 PM</FONT>
<BR><FONT SIZE=2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=2>Subject: RE: SQL question</FONT>
</P>
<BR>

<P><FONT SIZE=2>Dan (and Charlie),</FONT>
</P>

<P><FONT SIZE=2>Thanks.</FONT>
<BR><FONT SIZE=2>Good suggestions, but the IN clause contains just</FONT>
<BR><FONT SIZE=2>over 1700 values.</FONT>
</P>

<P><FONT SIZE=2>Puzzling, huh?</FONT>
</P>

<P><FONT SIZE=2>steve</FONT>
</P>

</BODY>
</HTML>

------_=_NextPart_001_01C26327.0A213CE0--

------=_NextPartTM-000-ffabd7d4-cf16-11d6-a0df-00508bf7dc0f Content-Type: text/plain;
 name="ESPN_Disclaimer.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ESPN_Disclaimer.txt"

********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************2

------=_NextPartTM-000-ffabd7d4-cf16-11d6-a0df-00508bf7dc0f--

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jamadagni, Rajendra
  INET: Rajendra.Jamadagni_at_espn.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Sep 23 2002 - 13:33:35 CDT

Original text of this message

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