Please help me to write the sql
Posted
by Lu Lu
on Stack Overflow
See other posts from Stack Overflow
or by Lu Lu
Published on 2010-06-02T03:45:53Z
Indexed on
2010/06/02
3:53 UTC
Read the original article
Hit count: 287
Hello everyone, I am a new with T-SQL. So, please help me to write the sql.
I have table Price (Code column is primary column):
Code Value
A1 234
A2 525
A3 566
I will input a string and the sql need to return a table.
Ex1: input 'A2' -> return:
Code Value
A2 525
Ex2: input 'A1 A3' -> return:
Code Value
A1 234
A3 566
Ex3: input 'A1 A3 A1' -> return:
Code Value
A1 234
A3 566
Ex4: input 'A1 A4' -> return:
Code Value
A1 234
Please help me. I am using SQL Server 2005. Tks.
© Stack Overflow or respective owner