Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Join 3 tables using their ids
abdujalil chuliev
Sep 26 2017 11:23 AM
181
Reply
Hi, I need a sql query which retrieves information from different tables and describe them in a datagrid. These are my tables.
tablename: register
-reg_id(PK)
-date
-timebegin
-begin_photo_id
-timeend
-end_photo_id
-pupils_id
tablename: pupils
-pupils_id(PK)
-name
-surname
-mid_name
-group_id
tablename: photos
-photo_id(PK)
-photo
Query meaning: Select date, timebegin, timeend from register; Select photo from photos where photo_id=begin_photo_if and photo_id=end_photo_id which is related to register table; Select concat(name, surname, mid_name) as fullname from pupils on pupils.pupils_id=register.pupils_id. That means instead register.pupils_id must be fullname which is taken from pupils. And last condition is show them where group_id=combobox.selectedvalue.
Result column names should be:
-fullname
-date
-timebegin
-photo
-timeend
-photo
where group_id=combobox_value
So I need some help, please.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to filter records from DataTable for a condition ">=" ?
Code First Approach