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

Home -> Community -> Usenet -> c.d.o.misc -> Re: General SQL statement question

Re: General SQL statement question

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 16 May 2005 10:37:17 -0700
Message-ID: <1116264796.135583@yasure>


dutilr_at_netscape.net wrote:
> You'll have to excuse me, but I'm a little light on my SQL skills. Can
> anyone tell me if the following SQL query should work or not? It has 4
> files, but the first file isn't linked to any of the other three files
> in the WHERE clause. I don't get it. Am I just missing something?
> Please let me know if you have any thoughts or suggestions.
>
> insert into cs02p10w
> SELECT DISTINCT a.csnwpl,d.opcatn,d.oppric
> FROM cs01p10w a, opprltp d,mspmj200 e, cs03p100 g
> WHERE d.opplst=&PL
> and d.opcatn=e.prdno
> and integer('0'||e.uprgrp)=g.cspgrp
> and d.oppric<>0
> and (substr(e.ubusut,1,1) between 'A' and 'H' or e.ubusut like 'M%' )
> and e.ubusut||e.ufamly<>'M O ' with NC

Impossible to tell because we have no way of knowing what columns, in what order, are present in cs02p10w.

Rewrite as:

insert into <table_name>
(<column_name_list)
SELECT ...

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon May 16 2005 - 12:37:17 CDT

Original text of this message

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