Thread: [SQL] Odd sql error ..

[SQL] Odd sql error ..

From
PropAAS DBA
Date:
I'm running this sql (see below) and I get this error:

ERROR:  column "last_modified" does not exist
LINE 3: ...repricefee"  , "tot_savings"  , "last_updated"  , "last_modi...
                                                             ^
HINT:  There is a column named "last_modified" in table "mytable", but it can
not be referenced from this part of the query.



Thoughts?




INSERT INTO myschema.mytable
               (  "invoiceseq"  , "claseq"  , "clasub"  , "invby"  , "invrectyp"
  , "invstatus"  , "invnum"  , "createdate"  , "postdate"  , "invdate"  ,
"invamt"  , "preinvnum"  , "preinvamt"  , "billed"  , "adjpaid"  , "expenses"  ,
"first_reviewsav"  , "first_reviewfee"  , "first_appealfee"  , "first_fraudsav"  ,
"first_fraudfee"  , "first_repricesav"  , "first_repricefee"  , "dent_reviewsav"
, "dent_reviewfee"  , "dent_appealfee"  , "dent_fraudsav"  , "dent_fraudfee"  ,
"dent_repricesav"  , "dent_repricefee"  , "fac_reviewsav"  , "fac_reviewfee"  ,
"fac_appealfee"  , "fac_fraudsav"  , "fac_fraudfee"  , "fac_repricesav"  ,
"fac_repricefee"  , "tot_savings"  , "last_updated"  , "last_modified"  )
               SELECT  "invoiceseq"  , "claseq"  , "clasub"  , "invby"  , "invrectyp"  ,
"invstatus"  , "invnum"  , "createdate"  , "postdate"  , "invdate"  , "
invamt"  , "preinvnum"  , "preinvamt"  , "billed"  , "adjpaid"  , "expenses"  ,
"first_reviewsav"  , "first_reviewfee"  , "first_appealfee"  , "first_fraudsav"
 , "first_fraudfee"  , "first_repricesav"  , "first_repricefee"  ,
"dent_reviewsav"  , "dent_reviewfee"  , "dent_appealfee"  , "dent_fraudsav"  ,
"dent_fraudfee"  , "dent_repricesav"  , "dent_repricefee"  , "fac_reviewsav"  ,
"fac_reviewfee"  , "fac_appealfee"  , "fac_fraudsav"  , "fac_fraudfee"  , "fac_repricesav"  ,
"fac_repricefee"  , "tot_savings"  , "last_updated"  , "last_modified"
               FROM old_schema.mytable

Re: [SQL] Odd sql error ..

From
Steve Midgley
Date:
On Sat, Sep 16, 2017 at 8:01 PM, PropAAS DBA <dba@propaas.com> wrote:
I'm running this sql (see below) and I get this error:

ERROR:  column "last_modified" does not exist
LINE 3: ...repricefee"  , "tot_savings"  , "last_updated"  , "last_modi...
                                                             ^
HINT:  There is a column named "last_modified" in table "mytable", but it can
not be referenced from this part of the query.



Thoughts?

If you just run the select portion of that insert statement, does it work?