W
wp231957
Unregistered / Unconfirmed
GUEST, unregistred user!
在以下查詢語句中,ttdsls101090.t_qono = ttipcs020090.t_qono = ttttxt010090.t_qono,t_seak, t_refe, t_text三個字段各不相同。
用Union函數將三個表中的兩個字段進行合並:
select
t_qono as 字段一,
t_seak as 字段二
From
ttdsls101090
union all
select
t_qono,
t_refe
From
ttipcs020090
union all
select
t_qono,
t_text
From
ttttxt010090
其查詢結果的排序方式應為:
字段一 字段二
t_qono t_seak
t_qono t_refe
t_qono t_text
但是,根據t_seak, t_refe, t_text三個字段的值不同,會對以上語句的結果進行自行排序,從而顛倒了t_seak, t_refe, t_text三個字段的顯示順序。
目前我想讓t_seak, t_refe, t_text三個字段的顯示順序按照Union聯合的三個查詢語句的順序來顯示。
請問,我該如果操作?!
用Union函數將三個表中的兩個字段進行合並:
select
t_qono as 字段一,
t_seak as 字段二
From
ttdsls101090
union all
select
t_qono,
t_refe
From
ttipcs020090
union all
select
t_qono,
t_text
From
ttttxt010090
其查詢結果的排序方式應為:
字段一 字段二
t_qono t_seak
t_qono t_refe
t_qono t_text
但是,根據t_seak, t_refe, t_text三個字段的值不同,會對以上語句的結果進行自行排序,從而顛倒了t_seak, t_refe, t_text三個字段的顯示順序。
目前我想讓t_seak, t_refe, t_text三個字段的顯示順序按照Union聯合的三個查詢語句的順序來顯示。
請問,我該如果操作?!