Jcat
          寵辱不驚,閑看庭前花開(kāi)花落~~
          posts - 173,comments - 67,trackbacks - 0
          --查詢short_name有重的記錄
          select short_name, count(*) from sys_catalog
          group by short_name
          having count(*)>1
          ?
          --給short_name加上unique約束
          alter table sys_catalog add unique (short_name)

          --給column01加上check in約束
          alter table son add constraint ck1 check (column01 in (1,2,3));

          --查詢與當(dāng)前系統(tǒng)時(shí)間最近的那個(gè)時(shí)間
          select some_dt, sysdate-some_dt as gap from test_date
          where sysdate-some_dt = (select min(abs(sysdate-some_dt)) from test_date)

          --加字段
          alter table?some_table add?some_column varchar2(20)

          --找出所有包含_(下劃線)的字段;網(wǎng)上說(shuō)用[_],但沒(méi)成功
          select * from test_date where email like '%/_%' escape '/'

          --啟動(dòng)用戶
          alter user scott account unlock;

          --更改密碼
          alter user scott indentified by tiger;
          posted on 2006-11-15 13:50 Jcat 閱讀(228) 評(píng)論(0)  編輯  收藏 所屬分類: Database
          主站蜘蛛池模板: 错那县| 思南县| 靖西县| 武邑县| 芷江| 翁牛特旗| 滦南县| 客服| 邓州市| 黄冈市| 德州市| 桦南县| 武平县| 博客| 安多县| 湘乡市| 紫金县| 乐安县| 邢台县| 沙坪坝区| 新巴尔虎左旗| 师宗县| 江城| 梨树县| 宝兴县| 津南区| 通山县| 桂平市| 股票| 玉屏| 亳州市| 阿尔山市| 竹溪县| 淮滨县| 河池市| 巩义市| 慈溪市| 北票市| 房山区| 余庆县| 涟水县|