Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I need convert the table1 in the table2 in script, can help me please
Tabla1: | |||
ID | name | key | Sec |
1 | A | 1AS | |
1 | A | 1AK | |
3 | C | 3CS | |
3 | C | 3CK | |
4 | D | 4DK | |
Tabla2: | |||
ID | name | key | Sec |
1 | A | 1AK | 1AS |
3 | C | 3CK | 3CS |
4 | D | 4DK |
Thanks.
Maybe like this:
KEYSEC:
LOAD * INLINE [
ID, name, key, Sec
1, A, ,1AS
1, A, 1AK,
3, C, ,3CS
3, C, 3CK,
4, D, 4DK,
];
NOCONCATENATE LOAD
ID, name,
maxstring(key) as key,
maxstring(Sec) as Sec
Resident KEYSEC group by ID,name;
drop table KEYSEC;
Maybe like this:
KEYSEC:
LOAD * INLINE [
ID, name, key, Sec
1, A, ,1AS
1, A, 1AK,
3, C, ,3CS
3, C, 3CK,
4, D, 4DK,
];
NOCONCATENATE LOAD
ID, name,
maxstring(key) as key,
maxstring(Sec) as Sec
Resident KEYSEC group by ID,name;
drop table KEYSEC;
Thanks a lot swuehl.