首页 > 数据库 > 数据库开发技术 > postgreSQL pk sybase
aterydb(PostgreSQL) Sybase
1.两个字符串连接
select 'abc'||'def'; select 'a'+'b';
2. 字段类型转换
select cast(1 as varchar(4)); select convert(varchar,1);
3. 求字段值得assci 码
select assci('abc') ; select assci('abc') ;
4.获得当前时间
select now(); select getdate();
select intNum1 +(_) intNum2 select intNum1 +(-) intNum2
5.主键生成策略
尚未发现 c_id int identify not null
6.判断某表的某字段是否为null,如果是null ,则。。。
select coalesce(names, '无名氏') as wk_ptn_cd from test.tab;
select isnull(names, '无名氏') as wk_ptn_cd from tab;
7. 删除已经存在的视图
drop view if exists viewName
if exists( select 1 from sysobjects where type='V' and name= 'V_ORGAN_GXGX')
drop view V_ORGAN_GXGX
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30110465/viewspace-1407278/ ,如需转载,请注明出处,否则将追究法律责任。