sqluser2006
05-02-2006, 06:45 PM
Hello,
This is my table:
firstname | lastname | id | referID
I need to be able to query the table and find all records where lastname field contains a part of some other firstname field and also both the records referID is the same.
For example:
firstname | lastname | id | referID
john ----- smith ------- 5 ----- 25
joe ------ robinson ----- 2 ----- 32
nothing ----- johnsmith ---- 3 --- 25
Here you can see the first record and the third record should be returned as the firstname "john" appears in the lastname of the third record and the referID is the same.
Any help will be appreciated! I have tried and tried but can't seem to figure it out.
Thanks!
This is my table:
firstname | lastname | id | referID
I need to be able to query the table and find all records where lastname field contains a part of some other firstname field and also both the records referID is the same.
For example:
firstname | lastname | id | referID
john ----- smith ------- 5 ----- 25
joe ------ robinson ----- 2 ----- 32
nothing ----- johnsmith ---- 3 --- 25
Here you can see the first record and the third record should be returned as the firstname "john" appears in the lastname of the third record and the referID is the same.
Any help will be appreciated! I have tried and tried but can't seem to figure it out.
Thanks!