Solved

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

Posted on 2007-11-14
3
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

615 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