MSSQLÈçºÎתΪORACLE
¸Õ¿ªÊ¼Ñ§Ï°´æ´¢¹ý³Ì£¬Ð´Á˸öMSSQLµÄ£¬²»Ì«ÊìϤORACLEµÄ¸ÃÔõôд¡£Ï£Íû¸÷λ´óÏÀ°ïæ
SQL code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[proc_getTotal]--<getTotal, gjjktemp, getTotal>
-- Add the parameters for the stored procedure here
--declare
@tableNamed nvarchar(20),
@start nvarchar(20),
@end nvarchar(20),
@centerid varchar(20),
@stationid varchar(20),
@itemid int,
@itemcode varchar(20),
@a int output
AS
BEGIN
--set @tableNamed = 'R_Hour_Data'
--set @start = '2009-1-1 0:00:00'
--set @end = '2010-12-31 0:00:00'
--set @centerid = 86
--set @stationid = 6
--set @itemid = 12516
--set @itemcode = '1CV'
declare @countOne int
declare @countTwo int
declare @s nvarchar(4000)
declare @startyear nvarchar(4) --¿ªÊ¼Äê
declare @endyear nvarchar(4) --½áÊøÄê
declare @tableName nvarchar(40) --±íÃû
declare @colName nvarchar(40) --ÁÐÃû
set @startyear = substring(@start,1,5)
set @endyear = substring(@end,1,5)
SET NOCOUNT ON;
if @tableNamed is not null
begin
set @s='select @i=count(*) from '+@tableNamed+'_'+@startyear+' as a where a.StaticDate >= '''+@start+''' and a.StaticDate<= '''+@end+''' and a.centerid = '+@centerid+' and a.stationid = '+@statio
Ïà¹ØÎÊ´ð£º
ÏÖÔÚÁ¬µÄÒ»Ô¶³Ìmssql£¬Ã¿´Î²éѯ±È½ÏÂý£¬ÏÖÔÚÏëһϰÑËùÓмǼ²éѯ³öÀ´ÓÃÊý¾Ý¼¯±£´æÆðÀ´£¬È»ºóÕë¶ÔÊý¾Ý¼¯Ôٴβéѯɸѡ¡£
ÏÖÔÚÎÊÏÂÄǸöÊý¾Ý¼¯ÈçºÎ±£´æ²éѯ¼Ç¼£¬¶øÔٴβéѯ£¬¶àлÁË¡£
¿ÉÒÔ°ÑÊý¾Ý¼¯ÖеÄÊý¾Ý·Åµ½ÄÚ´ ......
ÈçºÎ½«MSSQLÊý¾Ý¿âת»»ÎªMYSQL
ÔÚÍøÉÏÕÒÁ˺ܶà ˵µÄºÜÂÒ ÇëÎÊÓиßÊÖ¿ÉÒÔ½ÌÏÂÂð ллÁË
ûÓÐʲôºÃ°ì·¨¡£Á½ÕßÖ®¼ä»¹ÊÇÓÐЩ²îÒìµÄ¡£
Êý¾ÝÀàÐÍ£¬´æ´¢¹ý³ÌÓï·¨¡£
Èç¹ûÖ»ÊDZíºÍ¼Ç¼£¬Ôò¿ÉÒÔ°²×°Ò»¸öMYS ......
±íµÄ½á¹¹ÈçÏ£º
±í1£ºtb_big
×ֶΣºfalseIDÖµ£º1£¬2£¬3
×ֶΣºbigtype Öµ£ºA£¬B£¬C£¨ÓëfalseIDµÄÖµµÄλÖÃÒ»Ò»¶ÔÓ¦£¬¼´1¶ÔÓ¦A£¬2¶ÔÓ¦B£©
±í2£ºtb_small
×ֶΣºfalseID£¨Óëtb_bigµÄfalseID ......
ÒѾ¼ÜÉèºÃÁËÓÎÏ·£¬ÄÜÔËÐÐÁË£¡¡¾ÓÎÏ·²»ÊÇÎÒ×öµÄËùÒÔÀïÃæµÄÔ´ÂëʲôµÄ¶¼²»´óÇå³þ¡¿ÓÎϷʹÓõÄÊý¾Ý¿âÊÇMSSQLµÄ¡£
ÏëÓÃÍøվʵÏÖÔÚÍøÒ³ÖÐ×¢²áÕ˺ÅÀ´²åÈëµ½Ö¸¶¨µÄMSsqlÓû§±íÖÐ! ÒÔ±ã´ïµ½ÔÚÍøÕ¾×¢²áÁËÕ˺źóÄÜÔÚÓÎÏ·ÀïÃæ ......
ÎÒÓÃ("insert into LM_info ([content],[date],[username]) values ('"&content&"',date(),'"&username&"')")
ÊÇ´íÎóµÄ¡£
µ«ÊÇÎÒÓÃgetdat ......