0

Hi all,

Am having trouble trying to retrieve records using the following SQL statement:

SELECT distinct(dbS.tCline.mobile),dbS.tCline.msg,dbS.tCline.dest,
dbS.tCline.reply,dbS.tCline.status
FROM dbS.tCline,dbLaw.FORMER_GREY
where dbS.tCline.msg LIKE '%'||dbLaw.FORMER_GREY.C||'%' and
dbS.tCline.msg like '%ADMISSION%'

My problem now is that, the resultset retrieved includes everything from dbLaw.FORMER_GREY.C instead of only those rows that match dbS.tCline.msg rows.Please assist and be sure that your help is much appreciated.
Thank you in advance

Edited by dangari: n/a

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by dangari
0

Here is the full-proof solution:

select distinct(s.mobile),s.msg,r.C,s.dest,
s.reply,s.status from dbS.tCline s
INNER JOIN dbLaw.FORMER_GREY r ON s.msg LIKE concat('%',concat(r.C,'%')) where s.msg like '%ADMISSION%'

Many thanks!

Edited by dangari: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.