我有一个未标准化的表,我无法更改表的结构。该表包含 6 列来保存首选项,即preference_num1...preference_num6。我想从表中提取数据,以便看起来有 6 行,其中一种偏好在一行中。
为了清楚起见,输出应该是 Id,semester_start,year_start,email,preference_num。并且,每一行将分成 6 行。
Name Null Type
----------------------- -------- -------------
ID number (primary key)
YEAR_START NUMBER
SEMESTER_START VARCHAR2(8)
EMAIL VARCHAR2(100)
PREFERENCE_NUM_1 VARCHAR2(1)
PREF_INSTITUTION_NAME_1 VARCHAR2(100)
PREF_INSTITUTION_CODE_1 VARCHAR2(15)
PREF_COURSE_TITLE_1 VARCHAR2(100)
COURSE_CODE_1 VARCHAR2(15)
OFFERING_LABLE_1 VARCHAR2(15)
PREFERENCE_NUM_2 VARCHAR2(1)
PREF_INSTITUTION_NAME_2 VARCHAR2(100)
PREF_INSTITUTION_CODE_2 VARCHAR2(15)
PREF_COURSE_TITLE_2 VARCHAR2(100)
COURSE_CODE_2 VARCHAR2(15)
OFFERING_LABLE_2 VARCHAR2(15)
PREFERENCE_NUM_3 VARCHAR2(1)
PREF_INSTITUTION_NAME_3 VARCHAR2(100)
PREF_INSTITUTION_CODE_3 VARCHAR2(15)
PREF_COURSE_TITLE_3 VARCHAR2(100)
COURSE_CODE_3 VARCHAR2(15)
OFFERING_LABLE_3 VARCHAR2(15)
PREFERENCE_NUM_4 VARCHAR2(1)
PREF_INSTITUTION_NAME_4 VARCHAR2(100)
PREF_INSTITUTION_CODE_4 VARCHAR2(15)
PREF_COURSE_TITLE_4 VARCHAR2(100)
COURSE_CODE_4 VARCHAR2(15)
OFFERING_LABLE_4 VARCHAR2(15)
PREFERENCE_NUM_5 VARCHAR2(1)
PREF_INSTITUTION_NAME_5 VARCHAR2(100)
PREF_INSTITUTION_CODE_5 VARCHAR2(15)
PREF_COURSE_TITLE_5 VARCHAR2(100)
COURSE_CODE_5 VARCHAR2(15)
OFFERING_LABLE_5 VARCHAR2(15)
PREFERENCE_NUM_6 VARCHAR2(1)
PREF_INSTITUTION_NAME_6 VARCHAR2(100)
PREF_INSTITUTION_CODE_6 VARCHAR2(15)
PREF_COURSE_TITLE_6 VARCHAR2(100)
COURSE_CODE_6 VARCHAR2(15)
OFFERING_LABLE_6 VARCHAR2(15)
DATA_EXTRACTION_DATE DATE
OFFER_DATE_1 DATE
OFFER_RESPONSE_1 VARCHAR2(20)
FINAL_OFFER_RESPONSE_1 VARCHAR2(20)
OFFER_DATE_2 DATE
OFFER_RESPONSE_2 VARCHAR2(20)
FINAL_OFFER_RESPONSE_2 VARCHAR2(20)
OFFER_DATE_3 DATE
OFFER_RESPONSE_3 VARCHAR2(20)
FINAL_OFFER_RESPONSE_3 VARCHAR2(20)
OFFER_DATE_4 DATE
OFFER_RESPONSE_4 VARCHAR2(20)
FINAL_OFFER_RESPONSE_4 VARCHAR2(20)
OFFER_DATE_5 DATE
OFFER_RESPONSE_5 VARCHAR2(20)
FINAL_OFFER_RESPONSE_5 VARCHAR2(20)
OFFER_DATE_6 DATE
OFFER_RESPONSE_6 VARCHAR2(20)
FINAL_OFFER_RESPONSE_6 VARCHAR2(20)
谢谢