How to get Specified UserName from my table? [Resolved]

Posted by Iluvdotnetfunda under Sql Server on 2/23/2012 | Points: 10 | Views : 895 | Status : [Member] | Replies : 2
Hi Everyone,

Special Day,

I need an SQL statement, how to get particular Username from the given table.
For example my table name is "dotnet" and column name is "funda" and uername is "xyz".
I had written in this way
select * from Dotnet where funda = ' " + xyz + " ';
In this case i am getting all the columns names, but i am not getting the content present in the "xyz"


Thanks&Regards
iluvdotnetfunda




Responses

Posted by: Neer on: 2/23/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved

Select Funda from Dotnet Where Funda = 'xyz'

if xyz is variable , session or control's value than only write ' " + xyz + " '
if its static then type 'xyz'

-Neer

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 5/19/2012 [Member] Starter | Points: 25

Up
0
Down
HI,

METHOD 1:

SELECT * FROM DOTNETFUNDA

WHERE FUNDA='XYZ'

METHOD 2:

SELECT * FROM DOTNETFUNDA
WHERE FUNDA LIKE '%XYZ'

REGARDS
SRIRAM.R


sriram

Iluvdotnetfunda, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response