Database Query with no key values
Moderators: chulett, rschirm, roy
Database Query with no key values
I am trying to combine input from a transformer stage along with a max id value from a db2 table in datastage. The information in the two inputs is not related to do a lookup on a key value. Has anyone ever done this?
Use a pseudo column with a literal value as the key in your select max query. Now do the lookup using the literal value.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
A pseudo column:
will return two columns of data: NOT_REAL_COLUMN and MAX_KEY in your result set.
A pseudo column is a literally defined column that doesn't exist in the underlying data. You supply an alias to give it a name. A very elementary SQL technique.
Code: Select all
select 'I am not a real column' "NOT_REAL_COLUMN", max(primary_key) "MAX_KEY" from your_table"
A pseudo column is a literally defined column that doesn't exist in the underlying data. You supply an alias to give it a name. A very elementary SQL technique.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle