TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abdujalil chuliev
NA
400
41.2k
Join 3 tables using their ids
Sep 26 2017 11:23 AM
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.
Reply
Answers (
2
)
How to filter records from DataTable for a condition ">=" ?
I'm trying to get a tool tip for gird view header? Pls help