Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

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

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
Sanjeet
Asked:
Sanjeet
  • 2
1 Solution
 
digital_thoughtsCommented:
USE DISTINCT
0
 
digital_thoughtsCommented:
Sorry, disregard the first post, you need to use OR

select
      OBjectID
from
      PTUsers
where
      LoginName = 'metatree\jmajorve'
      OR LoginName = 'metatree\jkarasek'
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
select OBjectID  from PTUsers
where LoginName  in (  'metatree\jmajorve' ,  'metatree\jkarasek' )
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now