字段連接的各种數据庫的寫法

// 查询单表
public static void Querygx()
{
Session s = SessionFact.getSession();
Query q = s.createQuery("select A.cname||A.cid from Classes A");
List list = q.list();
SessionFact.close();
for(int i=0;i<list.size();i++)
{
System.err.println(list.get(i));

}
}

字段連接的各种數据庫的寫法

以下簡單介紹字段連接的各种數据庫的寫法

db2
select dpt_no||dpt_nam from db2admin.bs

dptms

select dpt_no CONCAT dpt_nam from db2admin.bsdptms
oracle
select dpt_no||dpt_nam from db2admin.bsdptms
select concat(dpt_no,dpt_nam) from db2admin.bsdptms
informix
select dpt_no||dpt_nam from db2admin.bsdptms
sybase
select dpt_no||dpt_nam from db2admin.bsdptms
access
select dpt_no+dpt_nam from db2admin.bsdptms
foxpro
select dpt_no+dpt_nam from db2admin.bsdptms
SQLSERVER
select dpt_no||dpt_nam from db2admin.bsdptms

你可能感兴趣的:(oracle,db2,Sybase,Access,Informix)