Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 April 21st, 2004, 01:10 AM
YuLing YuLing is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 44 YuLing User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via ICQ to YuLing
select name that is the same??

Hi,

Need a bit help...

I need to create a new table that keep track of student's transfer location

Example:

student_info
|-Name-|-Location-|........
**********************
|-ABCD---School1-|....
|-BCDE---School1-|....
|-CDEF---School2-|....
|-ABCD---School3-|....
|-BCDE---School3-|....
|-DEFG---School2-|....
|-ABCD---School2-|....
|-CDEF---School3-|....
|-ABCD---School1-|....
|-EFGH---School2-|....

Then from the student_info table need to have a new table with student transfer location info...but if a student which have no transfer it would not be extracted to the new table.

new_table
|-Name-|-Location-|
*****************
|-ABCD--School1-|
|--------School3-|
|--------School2-|
|--------School1-|
|-BCDE--School1-|
|--------School3-|
|-CDEF--School2-|
|--------School3-|

How do i do a query to select student name that is the same from the same table (stdent_info)??

select name, location from student_info
where name = name

Thanks


regards
YuLing

Last edited by YuLing : April 21st, 2004 at 01:35 AM.

Reply With Quote
  #2  
Old April 21st, 2004, 07:46 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 6
I assume that if a student transfer to the new location then school location must be entered into 'location' column otherwise this column will be remain empty. now you want to create a new table for students those have transfered to new school. on behalf of this logic, a query which creates a table is given below:

CREATE TABLE new_table AS SELECT name, location FROM student_info WHERE location IS NOT NULL
/

Regards,

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > select name that is the same??


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT