Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm seeing some weird things happening and would like to find out if it's me doing something wrong!
I'm loading some data into a table and then using this to create another table with just the most recent records in:
ResourcePriceTemp:
LOAD
Code as "Resource No.",
"Task Code",
"Effective Date",
"Unit Price",
"Brand Code";
SQL SELECT
Code,
"Task Code",
"Effective Date",
"Unit Price",
"Brand Code"
FROM NAVLive.dbo."Resource Price";
ResourcePrices:
load
"Resource No.",
"Task Code",
"Brand Code" as "Resource Brand Code",
"Unit Price",
max("Effective Date") as "Effective Date"
resident ResourcePriceTemp
group by "Resource No.", "Task Code", "Brand Code", "Unit Price";
drop table ResourcePriceTemp;
It will create the ResourcePriceTemp table (which it will then drop, I've tried uncommenting the drop table line and it does create this table). It doesn't seem to create the ResourcePrices table though and I've no idea why. Does anyone have any idea?
Regards,
Chris
Hello Chris,
Your syntax seems fine to me. Try using NOCONCATENATE before the LOAD in ResourcePrices, just in case it's being concatenated to ResourcePriceTemp, then dropped.
Hope this helps.
Hello Chris,
Your syntax seems fine to me. Try using NOCONCATENATE before the LOAD in ResourcePrices, just in case it's being concatenated to ResourcePriceTemp, then dropped.
Hope this helps.
Yes, looks like it may be doing that. May have somehow fixed it just by renaming a few fields but I'm sure you're suggestion would have worked also.
Chris