SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SUBSELECT IN A QUERY WITH LIKE HINT
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

eloykalvo
Starting Member

Spain
1 Posts

Posted - 09/26/2013 :  05:30:24  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2206 Posts

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

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000