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 2000 Forums
 SQL Server Development (2000)
 WHERE Clause

Author  Topic 

newuser123
Starting Member

7 Posts

Posted - 2010-04-08 : 08:01:50
Following WHERE clause will work in SQL?

select * from status_tbl
where (status = 'active' OR status = 'reject' OR status = 'In Progress')

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-08 : 08:04:50
yup. but short way is

select * from status_tbl
where status IN ( 'active','reject','In Progress')


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

newuser123
Starting Member

7 Posts

Posted - 2010-04-08 : 08:06:26
will work or not...

where (status = 'active' OR status = 'reject' OR status = 'In Progress')
Go to Top of Page

sathiesh2005
Yak Posting Veteran

85 Posts

Posted - 2010-04-08 : 08:13:23
Hi,

It will work, but it is not the correct way.
You should use like visakh said.

Regards,
Sathieshkumar. R
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-08 : 08:22:19
quote:
Originally posted by newuser123

will work or not...

where (status = 'active' OR status = 'reject' OR status = 'In Progress')


Why dont you try it and see for yourself

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -