CopyPastor

Detecting plagiarism made easy.

Score: 0.8374505616231247; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-01-07
by Dipak384

Original Post

Original - Posted on 2013-06-04
by sgeddes



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Assuming eid is a foreign key to uid, then something like this should work:
select u.uid, f.fname, l.lname from users u inner join firstname f on u.uid = f.eid inner join lastname l on u.uid = l.eid where f.fname like '%will%' or l.lname like '%will%'
If you also need to search the "uname" field, then add that to your where criteria with another or statement.
Results is:
UID FNAME LNAME 1 abc xyzs 3 czx yut
Assuming `eid` is a foreign key to `uid`, then something like this should work:
select u.uid, f.fname, l.lname from users u inner join firstname f on u.uid = f.eid inner join lastname l on u.uid = l.eid where f.fname like '%will%' or l.lname like '%will%'
- [SQL Fiddle Demo][1]
If you also need to search the uname field, then add that to your where criteria with another or statement.
Results:
UID FNAME LNAME 1 John Williams 3 Williams Smith
[1]: http://sqlfiddle.com/#!2/b6e1c/1

        
Present in both answers; Present only in the new answer; Present only in the old answer;