相當於建立一個臨時的表
with tt as (select * from t)
select * from tt;
查詢完就清除了,不佔空間
可以用於子查詢
如:
update t set a=(with tt as (select * from t)
select * from tt where tt.rowid=t.rowid );
*** with table as 的rowid與 他參考的表的rowid 是一樣的,因此可以透過rowid來關聯(也可以用原來的欄位)
文章標籤
全站熱搜
