Solved

SQL with more then 1 value for returning data from a field

Posted on 2007-11-14
3
211 Views
Last Modified: 2012-06-27
I need to return the user id for specific users from a table

such as


select OBjectID,  from PTUsers
where LoginName = 'metatree\jmajorve'
AND LoginName = 'metatree\jkarasek'
0
Comment
Question by:Sanjeet
  • 2
3 Comments
 
LVL 8

Expert Comment

by:digital_thoughts
ID: 20281767
USE DISTINCT
0
 
LVL 8

Accepted Solution

by:
digital_thoughts earned 250 total points
ID: 20281777
Sorry, disregard the first post, you need to use OR

select
      OBjectID
from
      PTUsers
where
      LoginName = 'metatree\jmajorve'
      OR LoginName = 'metatree\jkarasek'
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20281800
select OBjectID  from PTUsers
where LoginName  in (  'metatree\jmajorve' ,  'metatree\jkarasek' )
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now