freefly
          一門技術(shù),如果不能講出來,那么就是沒有理解,如果不能很好的講出來,那么就是理解不夠透徹!
          posts - 9,comments - 3,trackbacks - 0
          <2006年12月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          1。我們可以做一個(gè)平凡的人,但決不能做一個(gè)平庸的人
          2。給生活一個(gè)笑臉,生活會(huì)給你一個(gè)太陽
          3。路漫漫其修遠(yuǎn)兮,情深深且珍惜
          posted @ 2007-01-16 13:56 freefly 閱讀(229) | 評(píng)論 (0)編輯 收藏
          1. create view

                    ORACLE:    CREATE OR REPLACE VIEW V_FA_ADD_CO AS

                       SQLSEVER:    IF EXISTS (SELECT 1
                                                                      FROM  sysobjects
                                                                      WHERE  idobject_id ('V_FA_ADD_CO')
                                                                       AND   type = 'V')
                                              DROP VIEW V_FA_ADD_CO;
                                              CREATE VIEW V_FA_ADD_CO AS

              
          2. the equal between join and (+)
                
                 the table(its fields stay with (+)) right  join another  corresponding   table.
                 for example: select * from a,b where a.id=b.id(+)
                         equals  select * from b rigth join a on a.id=b.id
                         equals  select * from a left join a on a.id=b.id

                  notes:join先匹配有對(duì)應(yīng)的記錄,
                        (+)卻是按順序來的
           

              3. substr,substring
               
          for example: there is a table's field "userName" and it's value is "wanghuiling".
                 sqlserver: substring(userName,0,4) = "wan",substring(userName,1,4) = "wang"
                 oracle:  substr(userName,0,4)="wang",substr(userName,1,4)="wang"
             
           4. link sign
               sqlserver: "+"
              
          oracle:"||"
           
          5. update a table's some fields

               for example:there are two tables: students1 and students2

               sqlserver:update students     (can't use alias)
                             set name=s2.name,sex=s2.sex,age=s2.age,tel=s2.tel
                             from students s2 where s1.id=s2.id;
               oracle: update students1 s1
                         set (name,sex,age,tel)=
                         (select name,sex,age,tel from students2 s2 where s1.id=s2.id);

          6. Date
              for example:there are a field of  date type:input_date  and its value is 2007-08-09.   
              sqlserver : year(input_date)=2007,month(input_date)=8,day(input_date)=9
               oracle : to_char(input_date,'YYYY')=2007, to_char(input_date,'MM')=8, to_char(input_date,'DD')=9

               sDate : a java String variable
               sqlserver : input_date = '"+sDate+"' 
               oracle : input_date =  to_char( '" + sDate + "',' 'YYYY-MM-DD'')

          posted @ 2006-12-31 15:42 freefly 閱讀(578) | 評(píng)論 (0)編輯 收藏
          主站蜘蛛池模板: 塔城市| 吴忠市| 潼南县| 清流县| 上饶市| 琼结县| 华安县| 定边县| 乐亭县| 城固县| 乌恰县| 平乡县| 安图县| 临朐县| 敦化市| 革吉县| 留坝县| 尉氏县| 铜陵市| 霍州市| 和林格尔县| 大冶市| 象州县| 万载县| 竹溪县| 无极县| 阳山县| 来安县| 汽车| 孝感市| 麻阳| 栖霞市| 绵竹市| 塘沽区| 黄石市| 措勤县| 观塘区| 临西县| 五寨县| 饶河县| 巩义市|