以為在目前公司 ERP 不會用到VIEW , 沒想到居然遇到 SQL 指令超過2000字,就已逹程式上限的冏境 ...
所以還是來google 一下 oracle DB 怎麼建view
1.建立
1 |
<span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">CREATE</span> <span style="color: #0000ff;">VIEW</span> USER_NAME.VIEW_NAME <span style="color: #0000ff;">AS</span> <span style="color: #008000;">//以下為查詢語法</span> |
1 |
<span id="lnum2" style="color: #606060;"> 2:</span> <span style="color: #0000ff;">SELECT</span> * <span style="color: #0000ff;">FROM</span> USER_NAME.TABLE <span style="color: #0000ff;">WHERE</span> A_TABLE=<span style="color: #006080;">'SOMETHING'</span>; |
2.修改
1 |
<span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">REPLACE</span> <span style="color: #0000ff;">VIEW</span> USER_NAME.VIEW_NAME; |
3.刪除
1 |
<span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">DROP</span> <span style="color: #0000ff;">VIEW</span> USER_NAME.VIEW_NAME; |
4.查詢
1 |
<span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">select</span> * <span style="color: #0000ff;">from</span> VIEW_NAME |
(Visited 56 times, 1 visits today)