SQL Server Pivot Query using like rather than absolute value

I am running a simple sql server pivot query.  I tried to google this but because the word "like" is such a common word I can't get a good answer.  

Can I run a PIVOT query using the LIKE syntax ['%data%'] instead of using the absolute value in the field?  I have a large dataset where some of the values may be different but at least one word will be constant.  I am trying to avoid a long and arduous clean-up process.

Thanks,
gwarcherAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I'm tempted to just say no, but instead give us a data mockup of what you're trying to pull off here, with emphasis on what is being like'd.
0
gwarcherAuthor Commented:
Select PlaceName, ID, [SMITH, JOHN] as Smith, [DOE, JANE] as Doe
FROM
    (Select PlaceName, ID, Name, total from [table] where PlaceName = 'The Park') t
PIVOT
   (sum(total) FOR Name IN ([SMITH, JOHN], [DOE, JANE])) as pvt

The SMITH, JOHN and DOE, JANE is where I would like to have a LIKE check.

I have some fields that match this perfectly, and others that have noise but the SMITH will always be there.
0
Vitor MontalvãoMSSQL Senior EngineerCommented:
No, you can't because those values will be used as column names.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gwarcherAuthor Commented:
ok, thanks, I will just do clean up as needed then.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.