We help IT Professionals succeed at work.

Subqueries

dodgerfan
dodgerfan asked
on
261 Views
Last Modified: 2012-05-11
I think I need a subquery here, but I do not know for sure and I have no experience with them. I have a SQL Server 2005 database. I need to create a view that will return all of the records with a certain status that I'm responsible for. My responsibility is determined by the code the record is assigned that conincides with the codes I'm responsible for. There are 100 different codes, and I can me assigned to any number fo them. So the main record table has 1500 records in it. Each record has a status(1, 2, 3, 4) and a code(a, b, c, d, etc.). I am assigned to 5 different codes (a, b, c, d, e). I want to return any record with a status of 1 in any of the codes I'm assigned to. What is the best way to do this? I hope this is clear. Thanks
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
SharathData Engineer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.