|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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, |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > select name that is the same?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|