Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
I need help of writing script of creating unique key of 4 columns from 2 tables. please help me at earliest
-----------************----------------------
LIB CONNECT TO 'DATABASE';
[TABLE 1] :
Load
Column 1 as AA
Column 2 as BB
Column 3 as CC;
SQL SELECT "Column 1", "Column 2", "Column 3" FROM DATABASE Table;
[TABLE 2] :
Load
Column X as XX
Column Y as YY
Column Z as ZZ;
SQL SELECT "Column X", "Column Y", "Column Z" FROM DATABASE Table;
Please help me what should I add in the script to create another table or add in any of the above table where I can make unique key as below.
CONCATENATE: Column Name: UNIQUEKEYADDR = AA&'-'&BB&'-'&XX'-'&YY
Please help me at earliest !!
You can create a composite key by concatenating multiple fields that together.
Use the Autonumber function to generate a synthetic key in both table.
[TABLE 1] :
Load
Autonumber(AA & BB & CC) as Key,
[TABLE 2] :
Autonumber(XX & YY & ZZ) as Key,
CONCATENATE ([TABLE 1]) // Concatenate TABLE 1 and TABLE 2
LOAD
Key,
XX,
YY,
ZZ
RESIDENT [TABLE 2];
****Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.****
Hello,
Thanks for the revert,
I want to create new table with Concatenate of columns of Table 1 and 2. I will still need the data of Table 1 and Table 2 individual for analysis.
So just to clear I will need a column that is Concatenate of Column 1&Column 2& Column X& Column Y in new table.
please help me in this
Thanks