Link to home
Start Free TrialLog in
Avatar of adskarcox
adskarcoxFlag for United States of America

asked on

Large SQL Query

Hello, I am working to build a fairly large and complex SQL Query.  Sample tables for this query are listed below.

PORTFOLIO
ID    OwnerID    StatusID

1      44                777

OWNER
ID           FirstName    LastName

44           John             Smith

STATUS
ID             StatusText

777           Active
555           Inactive

CAR
ID        PortfolioID     CarName

5555    44                   Mustang
6666    44                   Camero


This is the row that I need to retrive from the database:

OwnerFullName  OwnerCar1    OwnerCar2    OwnerPortfolioStatusText
John Smith             Mustang         Camero            Active


Any assistance would be greatly appreciated.

Environment: SQL Server 2008
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Hi, you're working on this already, can you post what you did sofar and the outcome? The query itself should just be a couple of joins.
Avatar of adskarcox

ASKER

gerwinjansen - thanks for the reply.  The joins aren't going to be hard- the part that may get tough is how to grab data from multiple rows in the CAR table.  I'm not certain at this point how to accomplish that so that just one row is created in the dataset.

Thanks.
SOLUTION
Avatar of James Murrell
James Murrell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial