I just want to ask if I got my T-SQL right? I write a statement to get all task and project for login user
SELECT Users.userName, Tasks.taskName, Tasks.priority AS TaskPriority, Tasks.createdOn AS TaskcreatedOn, Tasks.estTime, Projects.projectName, Tasks.taskID, Users.userID, Projects.projectID
FROM Users INNER JOIN Users_projects AS usp ON usp.userID = Users.userID
INNER JOIN Projects ON usp.projectID = Projects.projectID
INNER JOIN Projects_tasks ON Projects.projectID = Projects_tasks.projectID
INNER JOIN Tasks ON Projects_tasks.taskID = Tasks.taskID
what happened when you tested it?
it run without any problem but just I want to make sure I get right and to see if their are more way to optimize it ?