on 03-16-2022 7:04 PM
Hi All,
I have to compare data of two tables using wildcard.
Data should be there in first table but not in second table.
Common field between both the tables are
Rollno = batch
My data is in below format:
Table-1 Table-2
Rollno Batch
A:123 123
B:423 C:657
Expected output: B:423
My problem is how to link these two tables on the basis of like operator.
Please suggest me an answer to solve this query.
Thanks in advance!!!
Hi Priya,
I'm not sure, if you want to compare A:123 with 123 ?
in this case, you can use instr.
String Functions - SAP Help Portal
where instr( a.rollno , b.batch ) > 0)
select a.rollno
from table_1 as a
where not exists (
select 1
from table_2 as b
where b.batch = a.rollno )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Priya,
why do you want to use a LIKE operator?
You can use an EXISTS predicate in the WHERE clause to select all data.
Or you do an LEFT OUTER JOIN and filter on NULL values with the IS NULL predicate.
Regards,
Jörg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.