April 11, 2012 at 12:31 pm
hbtkp (4/11/2012)
it doesnt matter , how do i get those value in select stm
It does matter.
Going down the same road as with of the other OPs. I think it's time to walk away.
April 11, 2012 at 12:47 pm
i havent done anything for this ,trying to use case but doesnt work
April 11, 2012 at 12:59 pm
hbtkp (4/11/2012)
i havent done anything for this ,trying to use case but doesnt work
well until you provide concrete details we've asked for for 3 forum pages so far, none of the volunteers can help you.
We do wish you all the best in fixing your issue yourself!
Lowell
April 11, 2012 at 2:02 pm
ok i need to match @% in my query ,how to do that
if i do using like '@%' its not working
April 11, 2012 at 2:09 pm
hbtkp (4/11/2012)
ok i need to match @% in my query ,how to do thatif i do using like '@%' its not working
There's no such thing as just [@] in SQL.
@ begins the name of a variable, and it must be two characters minimum including the @ sign.
@_ would be allowed, for example, or @a.
DECLARE @Var varchar(10)
SET @Var = 'pen' + '%' --note i'm adding the % here
SELECT * From MyTable Where SomeColumn like @Var
Lowell
April 11, 2012 at 2:12 pm
will this work '@_%'
April 11, 2012 at 2:13 pm
@ is not in sql,it just constant in my sql
April 11, 2012 at 2:16 pm
ok, then if you were searching email addresses for example, and you want to find items with teh @ symbol,then it's like this:
DECLARE @Var varchar(10)
SET @Var ='%' + '@' + '%' --note i'm adding the % here
SELECT * From MyTable Where SomeColumn like @Var
or without a variable:
SELECT * From MyTable Where SomeColumn like '%@%'
Lowell
April 12, 2012 at 12:21 am
How does the database know that item3 holds the value "pen, pencil"?...Is there a table where you have specified that item3 refers to "pen, pencil"?....
If there is then you need to do a join of the two tables(the one you have mentioned and the other table where item3 has the values "pen, pencil") to get code and the value of item3("pen, pencil").
SQL tables hold the data you(users) store and when you query these tables, SQL returns only the same data which you have provided it with. It doesn't have any form of artificial intelligence to know what item3 is without you telling it what it is.
Vinu Vijayan
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply