Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 31st, 2013, 05:46 AM
88oole 88oole is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 88oole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 19 sec
Reputation Power: 0
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.

Thank you.

Reply With Quote
  #2  
Old February 4th, 2013, 02:12 AM
debasisdas's Avatar
debasisdas debasisdas is offline
Humble Learner
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Location: Bangalore, India
Posts: 279 debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)debasisdas User rank is First Lieutenant (10000 - 20000 Reputation Level)  Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3Folding Points: 1142847 Folding Title: Super Ultimate Folder - Level 3
Time spent in forums: 2 Months 3 Days 4 h 56 m 45 sec
Reputation Power: 118
Send a message via ICQ to debasisdas Send a message via AIM to debasisdas Send a message via Skype to debasisdas
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")

Reply With Quote
  #3  
Old February 4th, 2013, 03:45 AM
88oole 88oole is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 88oole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 21 m 19 sec
Reputation Power: 0
Thank you

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Selecting from two tables

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap