Hi Prabhu,
i need urgent help from you for sql script.
i have field called "Notes" in table ABC and have another table called XYZ.
XYZ table has five fields 1,2,3,4,5
the requirement is :
where 1=1
and abc.notes like '%xyz.1%'
and abc.notes like '%xyz.2%'
and abc.notes like '%xyz.3%'
and abc.notes like '%xyz.4%'
and abc.notes like '%xyz.5%'
did you understand?
notes field has some long strings... xyz table clumns string should match with that notes from the abc table.
how do i write the sql script.
becoz i have nearly 2000 records in the table.. can you help out plz....
its urgent.
thanks in advance
pinky
DROP TABLE PINKY1
DROP TABLE PINKY2
CREATE TABLE PINKY1(NOTES VARCHAR(100))
INSERT INTO PINKY1 VALUES('VENKAT')
INSERT INTO PINKY1 VALUES('VENKATESAN PRABU')
INSERT INTO PINKY1 VALUES('rENKAT')
INSERT INTO PINKY1 VALUES('AENKAT')
INSERT INTO PINKY1 VALUES('AENKAT')
INSERT INTO PINKY1 VALUES('zxNKAT')
INSERT INTO PINKY1 VALUES('zxNKAT')
INSERT INTO PINKY1 VALUES('zxNKAT')
INSERT INTO PINKY1 VALUES('VERESEAEz')
CREATE TABLE PINKY2(VAL1 VARCHAR(100),VAL2 VARCHAR(100),VAL3 VARCHAR(100),VAL4 VARCHAR(100),VAL5 VARCHAR(100))
INSERT INTO PINKY2 VALUES('VE%','%RE%','%SE%','%AE%','%E_')
INSERT INTO PINKY2 VALUES('BE%','%RE%','%SE%','%AE%','%E_')
INSERT INTO PINKY2 VALUES('SE%','%RE%','%SE%','%AE%','%E_')
INSERT INTO PINKY2 VALUES('DE%','%RE%','%SE%','%AE%','%E_')
SELECT * FROM PINKY1 INNER JOIN PINKY2 ON NOTES LIKE VAL1
WHERE NOTES LIKE VAL2 AND NOTES LIKE VAL3 AND NOTES LIKE VAL4 AND NOTES LIKE VAL5
Cheers,
Venkatesan Prabu .J
No comments:
Post a Comment