adskarcox
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
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
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.
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.
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.