|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to normalised a table with data in it?
Hi!
I have the following table: USER Table -------------- user id user name user group user location I would like to normalised it to USER2 TABLE ----------------- user id user name group id location id GROUP TABLE ------------------ group id group name LOCATION TABLE --------------------- location id location name What is the sql statement which could do this? Thank you. |
|
#2
|
|||
|
|||
|
Use the CTAS (Create Table As Select) command of SQL, An example is given below:
CREATE TABLE normal2 AS SELECT a. userid, a.user_name, b.group_id,b.group_name FROM table1 a, table2 b WHERE a.user_id = b.user_id / It is only an example not the exact query you wanted, but you can modifiy it. Lets see how you accomplish your task. Regards, |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > How to normalised a table with data in it? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|