home
training courses
why choose us?
solutions
support
company
LearnItFirst User Forum
Welcome Guest
Search
|
New Posts
|
Members
|
Log In
|
Register
SQL Server Forum - LearnItFirst.com
»
Transact-SQL Programming
»
DML (SELECT, INSERT, UPDATE, DELETE) Questions
»
MSSQL database
MSSQL database
Options
Previous Topic
·
Next Topic
mitgeld
Posted:
Friday, May 28, 2010 5:29:55 AM
Rank: Newbie
Joined: 5/28/2010
Posts: 1
Points: 3
Where do you live?: Amsterdam
Hello Everybody,
I'm working on a project for a work agency in the Netherlands.I made a java application for the workers to see what time they work at which company and which car they have to take to get there.
I want to retrieve this information from a MSSQL database into my java app into jtabels. The only problem i have is the MSSQL query to accomplish this.
These are the tables in my mssql database on a ms sql server:
tbl.EmployeeEmployee_ID PK
Employee_Name
Employee_House
tbl.EmployeeAssignment
Employee_ID
Assignment_ID
tbl.Assignment
Assignment_ID PK
Company_ID
Starttime
PickupTime
tbl.Company
Company_ID PK
Company_Name
Company_Info
tbl.Assignment
Car
Car_ID
Assignment ID
tbl.Car
Car_ID PK
Car_Number
Car_Location
Car_People
My goal for now is to select ALL from tbl.car where Employee_ID is "myID" and Assigment_ID is one of the maximum 2 IDs there are for a certain Employee.
Every Employee can work at more companies and every company has more employees. For every company there can be more cars assigned to it.
I have to finish this project soon and i really don't know how to fix this.I hope you guys can help me...
thanks
ps. if you want more details let me know....
Back to top
Scott Whigham
Posted:
Wednesday, June 02, 2010 7:39:40 AM
Rank: Super Mod
Joined: 3/20/2006
Posts: 476
Points: 1,053
Where do you live?: Dallas, TX
Show me the queries that you've written and it will be a little easier to help.
Back to top
Users browsing this topic
Guest
Forum Jump
SQL Server Database Administration
- General SQL Database Question & Answer
- Backup, Recovery and Disaster Recovery
- SQL Server Security
- Integration Services (SSIS) and DTS
Transact-SQL Programming
- DML (SELECT, INSERT, UPDATE, DELETE) Questions
- Stored Procedures, Triggers, & Functions
SQL Server Scripts, Code Samples and SSMS Custom Reports
- All SQL Server Versions
- SQL Server 2005/2008
- SQL Server Management Studio Custom Reports
Customer Service
- Video Requests
You
cannot
post new topics in this forum.
You
cannot
reply to topics in this forum.
You
cannot
delete your posts in this forum.
You
cannot
edit your posts in this forum.
You
cannot
create polls in this forum.
You
cannot
vote in polls in this forum.
SQL Server 2005 DBA Training Videos
SQL Server 2008 DBA Training Videos
Email this topic
RSS Feed
Watch this topic
Print this topic
Normal
Threaded