Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables. Table1 contains the all student details and Table contains only Passed student ID's. How can i get the only Failed student details.(I want load only fail student detilas).
Table1:
S.ID S.name DOB District
1 xxxxx 10051991 KADAPA
2 yyyyyy 10071991 CHITTORE
3 eeeeeee 05021991 NELLORE
4 ssssss 10051991 ANATAPUR
5. nnnnn 03031991 KADAPA
Table2:
S.ID(Passed)
1
3
4
I want load only fail student details; ( no need to load all table from the file)
EX: OUTPUT
S.ID S.name DOB District
2 yyyyy 10071991 CHITTORE
5 nnnnn 03031991 KADAPA
i think you may need an Alias field here .. no you won;t
Table2:
load * inline [
S.ID
1
3
4
];
load * inline [
S.ID,S.name,DOB,District
1,xxxxx,10051991,KADAPA
2,yyyyyy,10071991,CHITTORE
3,eeeeeee,05021991,NELLORE
4,ssssss,10051991,ANATAPUR
5,nnnnn, 03031991,KADAPA
] where not Exists([S.ID]);
May be use Not Exists([S.ID]) for your second one
Load * From Table1;
Load * From Table2 where Not Exists([S.ID]);
I would just change the order here
Load * From Table2;
Load * From Table1
Where Not Exists([S.ID]);
Hi,
You can use where not exist or you can do -
table 1
right join
table 2
Thanks,
Neha
i think you may need an Alias field here .. no you won;t
Table2:
load * inline [
S.ID
1
3
4
];
load * inline [
S.ID,S.name,DOB,District
1,xxxxx,10051991,KADAPA
2,yyyyyy,10071991,CHITTORE
3,eeeeeee,05021991,NELLORE
4,ssssss,10051991,ANATAPUR
5,nnnnn, 03031991,KADAPA
] where not Exists([S.ID]);
But i take the same data from database, but it's not working.
ODBC CONNECT TO co;
Table1:
LOAD SID;
SQL SELECT *
FROM mohan.dbo.studentpassdetails;
Table2:
LOAD SID,
Student,
address,
DOB;
SQL SELECT *
FROM mohan.dbo.Studentdetails
where not exists SID;
Please help me
;
Try putting parenthesis around SID within Where not Exists()
Table1:
LOAD SID;
SQL SELECT *
FROM mohan.dbo.studentpassdetails;
Table2:
LOAD SID,
Student,
address,
DOB;
SQL SELECT *
FROM mohan.dbo.Studentdetails
Where not Exists(SID);
i got error in this type:
SQL##f - SqlState: 37000, ErrorCode: 102, ErrorMsg: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'SID'.
SQL SELECT *
FROM mohan.dbo.Studentdetails
where not Exists (SID)
My bad, try this
Table1:
LOAD SID;
SQL SELECT *
FROM mohan.dbo.studentpassdetails;
Table2:
LOAD SID,
Student,
address,
DOB
Where not Exists(SID);
SQL SELECT *
FROM mohan.dbo.Studentdetails;
Yes It's working. Thanks sunny.
At the same time, If i have
Table1:
SID1
Table2
SID
How can i use that statement. (where not Exists(SID))