question

Muhammad_Aatif avatar image
Muhammad_Aatif asked

Selection From multiples tables

I need to **select Class.ID, Class.ClassName,Class-Group.GroupName,Subject.SubjectName** from the given five tables. i have tried more than 10 queries but not helpfull. if anyone can help would be much appreciated. the tables are attached in attachment, **I'm facing problems in WHERE CLAUSE**. Thanks in Advance.![alt text][1] [1]: /storage/temp/3793-img.jpg
tables
img.jpg (411.2 KiB)
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JohnM avatar image JohnM commented ·
What have you tried this far? And what's the WHERE criteria? You don't mention that in the question.
1 Like 1 ·
Muhammad_Aatif avatar image Muhammad_Aatif commented ·
I was facing problems in the where criteria, that's why i didn't mention anything about that. i haven't tried any joins as one in the below answer.
0 Likes 0 ·

1 Answer

·
virendrasingh_77 avatar image
virendrasingh_77 answered
SELECT Class.ID, Class.ClassName,[Class-Group].GroupName,[Subject].SubjectName FROM Class INNER JOIN [Class-Group] ON [Class-Group].ClassId= Class.Id INNER JOIN [Class-Subject] ON [Class-Subject].ClassId= Class.Id INNER JOIN [Subject] ON [Subject].Sub-Id=[Class-Subject].Sub-Id
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Muhammad_Aatif avatar image Muhammad_Aatif commented ·
Thank You so much #virendrasigh_77, we changed our ERD and solved the problem. but it's much appreciated to hear from you.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.