Hi,
My requirement is to get the Max(col1) and use this value to increment by one for each input row and create a load file, subsequently this load file used to load the table. when i use the sql using MAX on a column in ODBC stage it is giving error "Fatal error not a valid Identifier MAx(col1)"
is there any other way to get the max number and use that number to process the data?
Thanks
Max of a column from Oracle table
Moderators: chulett, rschirm, roy
I got it correct, and working fine
I used following SQL
If are they any other way please let me know!
Thanks,
I used following SQL
Code: Select all
SELECT 1 as ID, nvl(MAX(COL1),0) AS MAXNBR FROM TABLE1
Thanks,
Hi
The following way better. Apply Max after Nvl
SELECT 1 AS ID, MAX(NVL(COL1,0)) AS MAXNBR FROM TABLE1
The following way better. Apply Max after Nvl
SELECT 1 AS ID, MAX(NVL(COL1,0)) AS MAXNBR FROM TABLE1
Titto wrote:I got it correct, and working fine
I used following SQLIf are they any other way please let me know!Code: Select all
SELECT 1 as ID, nvl(MAX(COL1),0) AS MAXNBR FROM TABLE1
Thanks,