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.
Author |
Topic |
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2010-08-03 : 05:14:47
|
Hi,I'm trying to combine a LIKE clause with a subqueryWHERE v.vehicletxt LIKE (SELECT TOP 1 cvehicle_shortmodtext FROM PUB_CAR..capvehicles WHERE cvehicle_modtext = 'A3 CABRIOLET')I want the LIKE to have wildcards at each site, i.e. '%value%', how can I do this with the returned value of the subqueryThanks |
|
Kristen
Test
22859 Posts |
Posted - 2010-08-03 : 05:22:29
|
WHERE v.vehicletxt LIKE '%' + (SELECT TOP 1 cvehicle_shortmodtext FROM PUB_CAR..capvehicles WHERE cvehicle_modtext = 'A3 CABRIOLET') + '%' |
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-08-03 : 05:23:17
|
orWHERE v.vehicletxt LIKE (SELECT TOP 1 '%' + cvehicle_shortmodtext + '%' FROM PUB_CAR..capvehicles WHERE cvehicle_modtext = 'A3 CABRIOLET') |
 |
|
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2010-08-03 : 05:33:37
|
Thanks :) |
 |
|
|
|
|