ÇóÖúSQL´æ´¢¹ý³Ì
ÎÒÓÐÒ»¸öÊý¾Ý¿âÀïÃæµÄ±íÊǶ¯Ì¬Ôø¼ÓµÄ£¬Ã¿ÖÜ°´ÈÕÆÚÉú³ÉÒ»¸öбíÀ´¼Ç¼µÇ¼ÐÅÏ¢,Èçlog20090927£¨ÃüÃûÓйæÂÉ£©,¸ôÒ»ÖÜÔÙÉú³ÉÒ»¸ö
ÏÖÔÚÎÒÏëʹÓô洢¹ý³ÌÀ´²éѯËùÓеĵǼÐÅÏ¢£¬¾Í°üÀ¨ËùÓеÄÈÕÖ¾±í
¸ÃÈçºÎд²ÅºÃ
ÕâÓ¦¸Ã»áÓÐÒ»¸ö×÷Òµ°É..?
½¨ÒéLZ°ÑÏêϸһµãµÄ×ÊÁÏÌù³öÀ´
SQL code:
if object_id('log20090927')is not null drop table log20090927
go
create table log20090927( a int, b int,c int )
insert log20090927 select
1,3,4 union all select
2,2,2
if object_id('pro')is not null drop proc pro
go
create proc pro
(@b int, @rq varchar(20))
as
declare @s varchar(50)
set @s='log'+@rq
set @s='select * from '+@s+' where b='+ltrim(@b)
exec(@s)
go
exec pro 2,'20090927' ----Ò²¿ÉÒԸijÉÈÕÆÚ·¶Î§
a b c
----------- ----------- -----------
2 2 2
(1 ÐÐÊÜÓ°Ïì)
ÒòΪ±í»áÔö¼Ó£¬ËùÒÔÔڽű¾Àï²»»áд£¬¾ÍÏëµ½ÁË´æ´¢¹ý³Ì£¬Í¨¹ý±íµÄÃüÃû¹æÂɺÍtype='U'À´ÁªºÏ²éѯ
SQL code:
--ÿÖÜÐÇÆÚ¼¸Éú³ÉµÄ£¿£¿£¿£¿
¸ÐлÈýÂ¥µÄjs_szy
µ«ÊÇÄãÕâ¸öÊÇ´«µÝ²ÎÊý²éijһÖܵıí
ÎÒÊÇÏëÁªºÏÆðÀ´
°ÑËùÓÐÕâÑù°´ÈÕÆÚÃüÃûµÄ±í¶¼²éѯÁË
ÊDz»ÊÇÒªÓõ½Ñ»·£¿
SQL code
Code highlighting produced by Actipro CodeHighlighter (freeware)
Ïà¹ØÎÊ´ð£º
±¾ÈËc#ÐÂÊÖ ¿ÉÊÇÒªÇóÒªÓÃc# £¬sql2000¿ª·¢c/sµÄ¹¤×÷Á÷£¬Ò»Í·ÎíË®£¬Çë´ó¼Ò°ïæ°ï棬¸øµã˼·£¬ËµµÄÔ¼¾ßÌåÔ½ºÃ£¬ÎÒÒ²ºÃÍùÄǸö·½Ãæȥѧϰ
http://www.hxzi.com/view/61402.html
B/S°æµÄ£¬»ù±¾Ë¼ÏëÓ¦¸Ã²î²»¶àµÄ¡£¡£ ......
ÎÒÓõÄÊÇmysql5.1£¬Êý¾Ý¿â×Ö·û¼¯Îªutf8
ͨ¹ýdosÃüÁîÐе¼ÈëSQLÎļþ ³ö´í£¬ÎÞ·¨µ¼Èë¡£
½«SQLÎļþÖеÄÊý¾ÝÈ«²¿Ê¹ÓÃÓ¢ÎÄ ¿ÉÒÔµ¼Èë
ÇëÎÊÎÊÌâÔÚÄÄ£¿
×°¸öÖÐÎÄÈí¼þ¼´¿É.
ºÜ¶àÄêÒÔÇ°,Óùý¸öÒ»¸ ......
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......
Ö´ÐеÄ˳Ðò£º
1£©Îļþä¯ÀÀ¿ò£¨Ñ¡ÔñÎļþʹÓã©
Ñ¡ÔñºÃÎļþºó
µã»÷Ò»¸öµ¼Èë°´Å¥µÄʱºò £¬°ÑÉÏÃæÉÏ´«¿òÀïµÄcsvÎļþÒÔÒ»¸öIDΪÎļþÃû£¬ÉÏ´«µ½**/**Îļþ¼ÐÏÂ
2£©¶ÁÈ¡Õâ¸öÎļþ¼ÐϵÄcsvµÄÎļþ£¬×ª»»³Ésql
3 ......