SqlServer With tableName as怎么转成Oracle sql语句?

WITH cte
AS ( SELECT id ,
key
FROM result
WHERE label = '姜山'
AND type = 'ROUTE'
UNION ALL
SELECT g.id ,
cte.key
FROM result g
INNER JOIN cte ON g.parentid = cte.id
)
SELECT ccc.result_CODE ,
ccc.result_NAME ,
aaa.*
INTO #temp4
FROM result aaa
INNER JOIN cte bbb ON bbb.id = aaa.id
INNER JOIN main ccc ON aaa.key = ccc.id
WHERE aaa.label LIKE '%资料%';

1个回答

Oracle INTO关键字只有在存储过程赋值或插入语句用到,所以只需把INTO #temp4去掉即可

coco2d_x2014
甄齐才 这个怎么解决 > ORA-22835: 缓冲区对于 CLOB 到 CHAR 转换或 BLOB 到 RAW 转换而言太小 (实际: 2926, 最大: 4000)
9 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
SQL 语句转成ORACLE
[code=SQL][/code]rn1:and cast((cast(rep_b_year as varchar)+'-'+cast(rep_no as varchar)+'-1') as datetime)>='2009-6-1'rnand cast((cast(rep_b_year as varchar)+'-'+cast(rep_no as varchar)+'-1') as datetime)<='2010-7-1'rnrn2:and cast((cast(rep_b_year as varchar)+'-'+cast(rep_no as varchar)+'-1') as datetime)='2009-6-1'rnrn1:是按时间段查询来的,我怎么转成ORACLE语句呢?上面是查询出09年6月份的,如果我<=后面变成2010-7-1 我需要查询的是2009-6,到2010-7 月的纪录。。。。。注(如果>=,<=时间都是一样的话,就查询当月纪录)rnrn2:这个是查询单月....rnrn对ORACLE 不熟悉,时间比较紧迫,希望哪位好心的大哥帮帮忙。。。。。。
sql语句转成oracle
select right('00000'+Convert(nvarchar(50),max(Convert(int,bh)+1)),5) from J_topic where Parentbh=''rnrn这句在oracle里怎么写?谢谢
SqlServer的Sql语句与Oracle的Sql语句的区别
请大家帮忙看看,下面的Sql在Oracle里运行有什么错误rn1.rnbeginrn if exists(select * from 表1) thenrn select 1 from dual;rn elsern select 0 from dual;rn end if;rnend;rnrn2.rndeclarern Mcount number(1):=0;rnbeginrn select count(*) into Mcount from 表2 where m_id=1;rn if Mcount=0 thenrn select 1 from dual;rn elsern select 0 from dual;rn end if;rnend;
SqlServer的RIGHT语句如何转成ORACLE
请教:rnSELECT 'IGRP'+RIGHT(1000000001+ISNULL(RIGHT(MAX(ProTeamCode),9),0),9) as ProTeamCode FROM t_ProTeam WITH(XLOCK,PAGLOCK)rnrnSELECT RIGHT(1001+ISNULL(RIGHT(MAX(ProTeamVisiTCode),3),0),3) as ProTeamVisitCode FROM t_ProTeamVisit WITH(XLOCK,PAGLOCK) WHERE PROTEAMVisitCode like '0%'rnrn这两句在SQLSERVER中的语法,在ORACLE中应该如何修改?
Sqlserver 语句转成MySql语句
要转成一样的效果,用powerdesigner怎么转?能转吗?rnrncreate table publishers (rn publisherID int identity,rn publisherName varchar (30) NOT NULL,rn constraint pk_publishers primary key (publisherID)rn) rn;rncreate table authors (rn authorID int identity,rn firstName varchar (20) NOT NULL,rn lastName varchar (30) NOT NULL,rn constraint pk_authors primary key (authorID)rn) rn;rncreate table titles (rn isbn varchar (20) NOT NULL,rn title varchar (100) NOT NULL,rn editionNumber int NOT NULL,rn copyright varchar (4) NOT NULL,rn publisherID int NOT NULL,rn imageFile varchar (20) NOT NULL,rn price float NOT NULL,rn constraint fk_titles foreign key (publisherID)rn references publishers (publisherID), rn constraint pk_titles primary key (isbn)rn) rn;rncreate table authorISBN (rn authorID int NOT NULL,rn isbn varchar (20) NOT NULL,rn constraint fk_authorISBN_1 foreign key (authorID)rn references authors (authorID), rn constraint fk_authorISBN_2 foreign key (isbn)rn references titles (isbn)rn) rn;rncreate table bookusersrn(rn userId numeric identity,rn account varchar(20) not null,rn password varchar(20) not null,rn name varchar(20) not null,rn createTime datetime not null,rn constraint PK_BOOKUSERS primary key (userId)rn);rn
Oracle语句转成Sql server语句的问题
表t1中有两个字段code,sj_code分别表示单位代码和上级单位代码,现在要取出某一单位所有下级单位(包括下级的下级,直到最下级单位),原来在Oracle中有:rnselect code,sj_code from t1 connect by prior code = sj_code rnstart with code = 当前单位代码 order by codern就可查询到结果,可是在Sql Server中就不行了,要怎么在Sql Server中实现相同的功能????rn 请各位高手帮忙。。。。。。。。
简单问题: SQL 语句从 SQLServer转成 Oracle
select lb=isnull(LB,''),bm=isnull(BM,''),mc=isnull(MC,''),pybm=isnull(PYBM,''),pybm1=isnull(PYBM1,''),YPBM1=isnull(YPBM1,''), pybm2=isnull(PYBM2,''),ypbm2=isnull(YPBM2,''),PYBM3=isnull(PYBM3,''),YPBM3=isnull(YPBM3,''),YPJX=isnull(YPJX,''),JG=isnull(JG,0),YPLX=isnull(YPLX,''),BXBL=isnull(BXBL,0),BXLX=isnull(BXLX,''),GUIG=isnull(GUIG,'') from ylbxzjj.yy_ypfzb where (pybm like '%dky%' or pybm1 like '%dky%' or pybm2 like '%dky%' or pybm3 like '%dky%') and lb='1'rnrn请问上面这个在SQLServer 中可以执行的代码在 Oracle 中该如何写才能执行 !rnrn本人是第一次用 Orcale 谢谢rnrnrnrn
麻烦把SQL语句转成Oracle语句
如题,在线等rn[code=SQL]rndeclare @sql varchar(8000)rnset @sql='select ( 'rnselect @sql = @sql +'''' + unit_short_name + ',' +''''rnfrom (select distinct unit_short_name,unit_id from unit_info) as arnset @sql = @sql +') as unit_short_name'rnrnexec(@sql) rn[/code]
sql语句实例(Oracle SqlServer)
很全sql语句实例,并附有讲解。言简意赅讲解实例,进行练习。
sqlserver 和oracle 的sql 语句的差异
大家能说说 sqlserver 和 oracle sql 语句的差异吗 rn rn rn
sqlserver的sql语句到oracle的转换
新人一枚,最近在自己研究一个小练习项目,项目用到的数据库是sqlserver2002,其中有一张表,语句如下:rnrnCREATE TABLE [dbo].[tb_jsr](rn [id] [int] IDENTITY(1,1) NOT NULL,rn [name] [varchar](15) NOT NULL,rn [sex] [char](2) NULL,rn [age] [int] NULL,rn [tel] [varchar](20) NULL,rn [enable] [bit] NOT NULL,rn CONSTRAINT [PK_tb_jsr] PRIMARY KEY CLUSTERED rn(rn [id] ASCrn)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]rn) ON [PRIMARY]rnrn我现在用oracle数据库作为项目的数据库,请问大神们,下面的约束在oracle建表时应该如何书写sql?最好能把下面约束那块的代码给逐词分析一下,万分感谢~~~~~~~~~~~~~
求SQL转换工具(Oracle转成SQLServer)
求好用的SQL转换工具(Oracle转成SQLServer)
将这句sqlserver语句转成oracle语句,谢谢
delete a from a join b on a.m1=b.m1 and a.m2=b.m2rn
Oracle中的sql语句转成DB2的问题
SELECT COLUMN_NAME, DATA_DEFAULT FROM all_tab_columns WHERE OWNER = 'SSSOWNER' AND TABLE_NAME = UPPER('C_Status') AND COLUMN_NAME NOT IN ( SELECT COLUMN_NAME FROM all_ind_columns rnWHERE TABLE_OWNER = 'SSSOWNER' AND TABLE_NAME = UPPER('C_Status'))rnrn如何转变成DB2 的sql 语句?
一个很短sqlserver语句转成orcale语句
select aa [男/女] from bbrn怎么转成orcale,主要就是这个"/"
怎么把mysql的limit语句 转成SQLSERVER 的top语句
原来是mysql 要移到sqlserver上所以咳 想念 limit rnrn1.rnselect a.seq, a.ctime, a.title, a.code, a.market, b.name as author, c.name as forumname from t_content a,t_user b,t_forum c where a.author in (1) and a.checked='0' and a.author = b.seq and a.forumseq = c.seq order by publishtime desc limit 0, 12rn其中( 1 ), 0, 12 都是变量。rn
请教将oracle的sql语句转化为sqlserver下的sql语句
SELECT CLS_DESC,OBJ_DESC,SUM(ZTS) ZTS,SUM(ZJZ) ZJZ,SUM(ZCYX) ZCYX,SUM(ZX) ZX,SUM(XZ) XZ,SUM(DBYX) DBYX,SUM(DBF) DBF,SUM(TJDX) TJDX,SUM(AZTS) AZTSrnfrom (rnSELECT FL.CLS_DESC,SB1.OBJ_DESC,COUNT(SB.OBJ_CODE) ZTS,SUM(SB.OBJ_RESIDUAL) ZJZ,rndecode(SB.OBJ_STATUS,'ZCYX',COUNT(SB.OBJ_STATUS),to_number(NULL)) ZCYX,rndecode(SB.OBJ_STATUS,'ZX',COUNT(SB.OBJ_STATUS),to_number(NULL)) ZX,rndecode(SB.OBJ_STATUS,'XZ',COUNT(SB.OBJ_STATUS),to_number(NULL)) XZ,rndecode(SB.OBJ_STATUS,'DBYX',COUNT(SB.OBJ_STATUS),to_number(NULL)) DBYX,rndecode(SB.OBJ_STATUS,'DBF',COUNT(SB.OBJ_STATUS),to_number(NULL)) DBF,rndecode(SB.OBJ_STATUS,'TJDX',COUNT(SB.OBJ_STATUS),to_number(NULL)) TJDX,rndecode(SB.OBJ_STATUS,'AZTS',COUNT(SB.OBJ_STATUS),to_number(NULL)) AZTSrnFROM rnR5OBJECTS SB,R5CLASSES FL,R5MRCS BM,R5OBJECTS SB1rnWHERE rnSB.OBJ_CLASS=FL.CLS_CODE(+)rnAND SB.OBJ_OBTYPE='A'rnAND SB.OBJ_ORG='S02'rnAND SB.OBJ_CATEGORY=SB1.OBJ_CODE(+)rnAND SB.OBJ_MRC=BM.MRC_CODE(+)rnAND BM.MRC_CLASS='WX'rnAND NVL(BM.MRC_CODE,-1)=NVL(:P_1,BM.MRC_CODE)rnAND NVL(FL.CLS_CODE,-1)=NVL(:PFL,NVL(FL.CLS_CODE,-1))rnAND NVL(SB1.OBJ_CODE,-1)=NVL(:PZL,NVL(SB1.OBJ_CODE,-1))rnGROUP BY rnFL.CLS_DESC,SB1.OBJ_DESC,SB.OBJ_STATUSrnORDER rnBY FL.CLS_DESCrn)rngroup by CLS_DESC,OBJ_DESCrnORDER BY CLS_DESCrn
求:将Oracle的SQL语句 转换成 SqlServer 的SQL语句的方法
我现在的这个系统是用的Oracle,DAO里的所有SQL语句也都是符合Oracle的,现在我需要把这个系统转换成SQLServer版本,希望各位大虾说下,最好的办法是?
sql 转成oracle
and cast((cast(rep_b_year as varchar)+'-'+cast(rep_no as varchar)+'-1') as datetime)>=CONVERT(varchar(10),dateadd(YEAR,-1,'2009-1-1'),120)rnand cast((cast(rep_b_year as varchar)+'-'+cast(rep_no as varchar)+'-1') as datetime)<=CONVERT(varchar(10),dateadd(YEAR,-1,'2009-1-1'),120)rnrn时间很急,很急,各位帮帮忙。。。。
oracle 语句 转换SQLServer语句
oracle语句rnselect * from ZX_ZHONGGRMYXFCGSZX_GRXXJCB where SFZH = '452122199106224513' and XM = 'MMM' rnand ZTM = 9 and (to_char(JZSJ,'yyyy-MM-dd') >= '2015-03-27' or JZSJ IS NULL)
sql语句转成linq
select SUM(P.W) as w from order o left join product p on o.pid=p.ID where o.oid=100这个sql语句怎么转成Linq啊?求教
SQL语句转成HQL
[code=SQL]SELECT a.* FROM ecs_brand a join ecs_goods b on a.brand_id = b.brand_id group by a.brand_id order by count(*) desc[/code]rnmysql的语句,如何转成Nhibernate的HQL语句呢....
oracle的SQL转成mySQL的SQL
下面这段代码是oracle中用于取得'20090401'到'20090430'间所有日期的SQL,现在我们需要一个mySQL的,由于本人实在不会mySQL,同时时间又紧,所以希望各位帮忙看看,mySQL下这个SQL怎么写!rnselect to_date('20090401', 'yyyymmdd') + level - 1 as dayofyearrn from dualrnconnect by level <= to_char(to_date('20090430', 'yyyymmdd'), 'ddd')
关于ORACLE和SQLSERVER标准SQL语句问题
我现在的程序是用SQLSERVER数据库的,现在要改成即可以在SQLSERVER上跑,也可以在ORACLE上跑,但是程序只有一套,现在牵涉到标准SQL语句的问题,一些数据窗口里面的ISNULL,LEFT,CONVERT...等SQLSERVER关键字在ORACLE里面不能使用,请问关于标准SQL语句的问题哪位有一些好的想法?多多赐教!谢谢了
SQL语句大全(mysql,sqlserver,Access,Oracle)
sql语句(mysql,sqlserver,Access,Oracle)
求一SQL语句,SQLServer和Oracle
[img=https://img-bbs.csdn.net/upload/201308/06/1375766679_927616.jpg][/img]rnrn求不同Name在这些时间里的最大Count,最小Count,最大Count日期,最小Count日期rnrn有没有大神们能解决此问题啊?rn
求Oracle的sql语句的相应sqlserver查询语句
select count(*) FROM (SELECT id, title FROM news WHERE news_type='1')rnrnselect * from (select rownum as count,a.* from (SELECT id, title FROM news WHERE news_type='1' ) a) where count>0 and count<=10rnrn上面语句在Oracle中运行没问题,在sqlserver就出事了,请问要怎样改啊?
sqlserver语句换成oracle
运行怎么里面函数怎么改,语句如下。怎么换成oracle的函数? [img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/27.gif][/img]rnrnrnrnSELECT SUM(CONVERT(money, yavg)) / SUM(CONVERT(int, DAYS)) AS yavg, FproductID, NF, FproductNamernFROM (SELECT SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 9, 9) AS DAYS, rn SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 9, 9) * yuejunjia AS yavg, rn SUBSTRING(CONVERT(varchar(10), DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, GetDate) + 1, 0)), 20), 1, 4) AS NF, FproductID, rn FproductNamern FROM (SELECT DISTINCT c.FproductName, b.GetDate, b.yuehuanbi, b.yuetongbi, b.yuejunjia, b.FproductIDrn FROM dbo.ls_scb AS a INNER JOINrn dbo.ls_jgb AS b ON a.MarketID = b.MarketID INNER JOINrn dbo.ls_pzb AS c ON b.FproductID = c.FproductIDrn WHERE (a.MarketName = '上海市')) AS s) AS arnGROUP BY FproductID, NF, FproductName
Oracle 语句 转换 SQLServer
Oraclernselect * from (select T.*,rownum r from nncredit_article_class T) a where r >'3' and r <=9rnrnSQlServer 怎么写 rownum
SqlServer语句改成oracle
select * from v_vehicleorgview where 1=1 and parentid = '1' and O_keyid!=1;请问这条SqlServer的sql语句怎么转成oracle语句。另外请问SqlServer创建视图的语句可以用在oracle上吗?
请问这个SQL语句怎么转成linq
select *rnfrom(select * ,row_number() over(partition by merchantid order by addtime desc)rn as rowindex rn from ViewtbCoupons) arnwhere rowindex <= 1rnrn这个sql语句的作用是每个分类取最新的几条数据
这个sql 怎么转成oracle的语法啊。
DECLARE @i intrn SELECT @i = COUNT(*) FROM AttachmentGroup WHERE groupId = @gidrn IF @i = 0rn INSERT INTO AttachmentGroup(groupId) VALUES(@gid)
急:这个SQL语句怎么转成OEACLE的?
SELECT case when left('config_admin',5) = 'config' or left('config_admin',2) = 'db' or left('config_admin',4) = 'user' then 'A' else 'B' endrn语句里面的config_admin其实是ASP里面的一个变量,根据输入生成的上面这个SQL语句,返回'A'或'B',怎么转成ORACLE的?
ADO循环语句怎么转成sql语句
[code=C/C++]rn RxRecordset rst;rn sql="select * from A";rn rst.Open(sql);rn while(!rst.end())rn rn int Id=atoi(rst.GetFieldValue("Id"));rn RxRecordset rs;rn sql.Format("select top 100 * from %s where Id >= %d and Id<%d",B,Id*100,Id*100+99);rn rs.Open(sql);rn while(!rs.isend())rn rn rs.MoveNext();rn rn rst.MoveNext();rn rn[/code]
SqlServer的这条语句怎么改成oracle能用的
大致需求是这样的,判断一条记录在数据库中是否存在,存在的话就更新一下,不存在就插入。并且最后需要返回执行的结果,使用select将执行过程中保存的一些状态信息查询出来,返回结果集给调用程序。[color=#FF0000]但是不能定义变量实现,不能使用declare,不能使用oracle特有的语法。[/color] sql语句是调用程序传给数据库的,使用特有语法,调用程序会报错。调用程序是java的,而且调用程序是不允许修改的。rnrnif exists(select * from PurchBalanceBill where FID = 1014) rnBegin rn update PurchBalanceBill set Fnumber = '00000014',BanlancePrice = '153.0',rn CancelNum = '2.0',FDescription = '123'rn where FID = 1014rnEnd rnElse rnBegin rn insert into PurchBalanceBill( FID,Fnumber,BanlancePrice,CancelNum,FDescription)rn values ('KaRA8EO/Qe6OX/4w8n29N5eCbbY=','00000014','153.0','2.0','123') rnEnd rnrn........rnrnselect * from resultrnrn
oracle 语句转换 SQLServer 怎么写
[color=#FF0000]oracle[/color]rnselect * from (select * from nncredit_article where classoid='22' order by nncredit_article.RECORD_CREATE_TIME DESC ) s where rownum<='1' and verifystate=0 order by rownumrnrn
那位高人帮我把这个SQLServer下的语句转成Oracle的语言?
datediff(week,datetime1,datetime2)rn我在Oracle中没找到相似的函数,哪位大哥帮忙翻译以下,谢谢了!!
oracle 的sql语句怎么找出来?
我建库时的sql语句已经忘记了,rn请问怎么才能在oracle中找出建库的sql语句?
把这个oracle语句转成sql语句给java用
select zlgetmc@zdcj_ehv(8,csys,1) csys,zlgetmc@zdcj_ehv(4,cllx,0) cllx,clpp1||clxh as ppmc,lxdh from admin.vehi@zdcj_ehvrn把这语句转成sql普通语句rn@zdcj_ehv(8,csys,1)和admin.vehi@zdcj_ehv中的后边的@zdcj_ehv是什么意思啊?rnrnclpp1||clxh 这||又是什么意思啊?
帮我看看这个Sql server语句如何转成Oracle语句!
if not Exists(select * from Counter where KeyValue=vcKeyValue) thenrn insert into Counter(KeyValue) Values(vcKeyValue)rn elsern select isnull(CountValue,0) into iCountValue from Counter where rn KeyValue=vcKeyValue;rn end if;rn 关键是不知道Exists和isNull在oracle中对应的函数是什么,rn  另外想问一下,在oracle中如何查到这些函数的帮助rn  我用的是oracle8.05
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件

相似问题

2
关于限制行更新的触发器问题
3
用DbVisualizer连接的DB2数据库 如何执行SQL查询出来 表结构
1
jfinal oracle数据库映射model问题
4
【急】hive表数据太多,普通的查询语句都用不了,求解决【应该很简单】
6
请教拼接SQL字符转义问题
11
SQL查询语句提示”语法错误(操作符丢失)在查询语句Where....中,愁死了,请大师帮忙!
3
sql 语句查询满足2个条件的简便语句
1
sparkSql使用insert、create table tablename as select 。。。会报一个错,查了很久都没有查到原因。
2
sql语句判断字段和div内容相同
2
matlab中使用数据库更新语句whereclause,常量就可以更新 变量则更新不了,但是程序不会报错
2
spring data jpa如何自定义insert sql?批量保存数据
2
kettle中有源表和目标表,两个表的表输入的查询中的表名是一个变量,如何让源表中的数据更新到目标表中?
3
请教一个shell的写法对于列数不固定的文件把每列的值取出来,如然后写入insert SQL
0
求助一个shell的写法,或者提供思路也可以。
2
MySQL存图片路径,在JSP显示图片的代码怎么写?
1
QT 怎么样才能把Sqlite数据库表导出成txt或者csv?
1
网上下载的项目-导入ssm小米商城的后台项目访问登录界面login的时候无法跳转到其他页面是怎么回事?
1
django中 django.db.utils.ProgrammingError: (1146, "Table 'xxx' doesn't exist")的问题
2
MySQL 报错 com.alibaba.druid.sql.parser.EOFParserException: EOF
0
Mybatis如何使用注解方式设置resultMap的type属性。