Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Select Row contains values as 1
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

242 Posts

Posted - 08/28/2006 :  07:59:08  Show Profile  Send danasegarane76 an ICQ Message
Hi team,
I want to select a particular row where any fields name contains the value as 1.How can I.I am using vb as Front End and SQL server as back end.

Flowing Fount of Yak Knowledge

1907 Posts

Posted - 08/28/2006 :  08:08:06  Show Profile  Visit chiragkhabaria's Homepage  Send chiragkhabaria a Yahoo! Message
Somthing like this
Select * from TableName Where
Field1 = 1 or Field2= 1 or...

Go to Top of Page

Posting Yak Master

242 Posts

Posted - 08/28/2006 :  08:12:08  Show Profile  Send danasegarane76 an ICQ Message
Dear chiragkhabaria,
Thanks for your reply.The table has more that 25 columns.So i need some general Module.Any field can have a value as 1.But I need to select the value of any of the fieldss.
Go to Top of Page

Patron Saint of Lost Yaks

30421 Posts

Posted - 08/28/2006 :  08:14:42  Show Profile  Visit SwePeso's Homepage
Like this?
SELECT	Field1 f
FROM	TableName
WHERE	Field1 = 1
SELECT	Field2 f
FROM	TableName
WHERE	Field2 = 1
SELECT	Field3 f
FROM	TableName
WHERE	Field3 = 1

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 08/28/2006 :  10:01:31  Show Profile  Send madhivanan a Yahoo! Message
Why do you have this requirement?
Is the table normalised?


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000