Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All.
i have permanent employee details in table A and all contract employee details in table B.. and swipe in information for both of these and also visitors details are available in another table C..
Emp ID is the common key for all the tables. now how to get the 3rd category people like visitors.
Any pointers on How we can achieve this, Thanks in advance.
Concatenate all the records from tables A,B and C into one table and add a field that indicates what kind of record it is, e.g. 'permanent', 'contract', 'visitor'
thanks Much for the reply,
table A with permanent employee details.
table B with Contract employee details.
table C with all employee details along with visitors details.
So i want to substrct both table A and B from Table C so that will get the visitors information...is there any way to do that...??
i want the counts from table C which are not in table A and B...
Where not exists work for my above seanario !!
May be:
Either Permanent / Contract Employee, they'll have one type of Employee Code. For Visitors it'll be allocated differently.
So compare based on EmployeeID, where it's null for Visitors. In Table A, Add a Flag to indicate Permanent, In Table B, Add a Flag to indicate Contract, in Table C create a condition to check permanent or contract, so the remaining people falls in Visitors category.
Hi Vishal,
Try like this:
A:
Load
Name
from permanent;
concatenate
B:
Load
Name
from Contract ;
Join (A)
C:
Load
Name,
Name as NewName
from Allemp_visitor;
Noconcatenate:
😧
Load
Name,
if(Name=NewName,1,0) as Flag
resident A;
Drop table A;
Visitor:
Load
Name as VisitorName
resident D
where Flag=0;
Br,
KC
You can replace name with your empID field.
One other way:
A:
Load
Empid
from permanent;
concatenate
B:
Load
Empid
from Contract ;
Noconcatenate
C:
Load
count(Empid) as Countvisitors,
from Allemp_visitor
where not exists (Empid,Empid);
Br,
KC