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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Nested SQL statements request

Author  Topic 

anbaz
Starting Member

3 Posts

Posted - 2009-12-23 : 09:00:59
Hi All,

I am new to the SQL Server.

i want to write a nested SQL query for the followings:

I have a table

ObjectType SetUser create Edit Delete purge view Transfer SetPrivacy Invite DelMember Import Privacy
---------------------------------------------------------------------------------------------------------------

Workgroup NULL 3 64 64 15 1 64 64 32 64 NULL 1
Workgroup NULL 3 3 3 15 1 64 64 32 64 NULL 0
---------------------------------------------------------------------------------------------------------------

i want to select sub table of the above with only the value = '64'

Any one can help me to come out the nested SQL.
Thanks & Regards,
Anbaz

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-23 : 09:13:03
You're question seems a li'l confusing...what is your expected output for this data?
Go to Top of Page

anbaz
Starting Member

3 Posts

Posted - 2009-12-23 : 22:44:31
Hi VijayisOnly,

i want to select the columns which have the value of "64" other than the '64' i don't want to select
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-23 : 22:47:13
WHERE YourColumn = 64

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

anbaz
Starting Member

3 Posts

Posted - 2009-12-24 : 01:23:54
Hi,

I don't have any column like '64' but i have the value of "64" in some of the columns. my target is, i need to select only the record value = 64 which ever the columns have the '64'

i want a complete select statment to select which ever the column in table have the record value of "64"
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-12-24 : 11:16:21
As per your current table design...you will have to do
SELECT * 
FROM yourtable
Where create = '64' or Edit = '64' or delete = '64'
and so on
Go to Top of Page
   

- Advertisement -