Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- | column | pk | type |
- +------------+-----+--------------+
- | id | yes | int |
- | type | yes | enum |
- | c_date | | date |
- | qty | | int |
- | combine_id | | varchar(255) |
- | id | type | date | qty | combined_id |
- +-----+------+------------+------+---------------------+
- | 001 | CB04 | 2015-01-01 | 700 | 001_CB04_2015-01-01 |
- | 155 | AB01 | 2015-01-01 | 500 | 155_AB01_2015-01-01 |
- | 300 | AB01 | 2015-01-01 | 1500 | |
- select id
- , type
- , date
- , qty
- , id::text || '_' || type::text || '_' || date::text as combined_id
- from your_table
Add Comment
Please, Sign In to add comment