January 31st, 2013, 05:46 AM
Selecting from two tables
Good day to you all.
I have tables SUBJECT(subject_id, name, number) and PS(ps_id, subject_id, student_id). I need to select all from SUBJECT,subject_id and student_id from SP, joined by subject_id, where student_id needs to be read from session. I'm using asp.net with oracle database. Can anybody help me with the sql statement and how to get the value from the session.
February 4th, 2013, 02:12 AM
You can try something like this.
select s.*, p.subject_id, p.student_id
From subjects s, ps p
where s.subject_id = p.subject_id
and p.student_id in ("this is where you need to select you student_id from session")
February 4th, 2013, 03:45 AM