Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SUBSELECT IN A QUERY WITH LIKE HINT

Author  Topic 

eloykalvo
Starting Member

1 Post

Posted - 2013-09-26 : 05:30:24
Hi,
I´m a spanish oracle developer, my question is..
¿Is possible to use like hint with subselect? , i mean i want to find all rows in table A that contains a word in a field(CALLED CONTENT) in table B, concretely in a field called content too, i show you the idea although the syntax is incorrect.

select
' + char (39) + @country + char (39) + ' as PAIS,
A.ID,
A.IDUSUARIO MSISDN,
NULL AS MSISDN_COD,
convert(char(19),A.FECHA_ALVENTO, 121) AS FECHA_MO_LOCAL,
NULL AS FECHA_MO_LOCAL_D,
NULL AS FECHA_MO,
NULL AS FECHA_MO_D
from ' + @bdhist + '..ZED_MO_HIST as A
where (A.FECHA_ALVENTO >= '+ char(39) + @last_load_date + char(39) + ' and
A.FECHA_ALVENTO < dateadd(dd,+6,'+ char(39) + @last_load_date + char(39) + '))
and a.CODE=41
AND A.CONTENT LIKE (SELECT %CONTENT_FIELD_FROM_TABLE_B%)'

¿Could you please help me with that?
Regards.
Eloy.

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-09-26 : 05:41:58
Hi,
This is pure SQL Server forums... You can get better solution by posting at dbforums.com

--
Chandu
Go to Top of Page
   

- Advertisement -