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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 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
2241 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  
 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.08 seconds. Powered By: Snitz Forums 2000