¼Ç¼¼¸Ìõ¸Ð¾õ²»´íµÄsqlÓï¾ä
SELECT id,ip,from_unixtime(last_task_request_time) t1, from_unixtime(last_task_finish_time) t2
from yq_nodemanage
WHERE node_type=1
ORDER BY t1 DESC;
SELECT sum(unix_timestamp(gather_time)-unix_timestamp(publish_time))/(count(*)*60) from yq_bbs_docinfo
WHERE unix_timestamp(publish_time)>unix_timestamp(now())-12*3600
AND publish_time<gather_time;
Ïà¹ØÎĵµ£º
ʵÀý1£ºÖ»·µ»Øµ¥Ò»¼Ç¼¼¯µÄ´æ´¢¹ý³Ì¡£
ÒøÐдæ¿î±í£¨bankMoney£©µÄÄÚÈÝÈçÏÂ
Id
userID
Sex
Money
001
Zhangsan
ÄÐ
30
002
Wangwu
ÄÐ
50
003
Zhangsan
ÄÐ
40
ÒªÇó1£º²éѯ±íbankMoneyµÄÄÚÈݵĴ洢¹ý³Ì
create procedure sp_query_bankMoney
as
select * from bankMoney
go
exec sp_query_bankMoney
×¢ ......
Æô¶¯Êý¾Ý¿âÓʼþ¹¦ÄÜ
sp_configure 'show advanced', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE;
GO
-- ÅäÖÃÊý¾Ý¿âÓʼþ
-- Ìí¼ÓÓʼþÕË»§
execute msdb.dbo.sysmail_add_account_sp
@account_name = 'ÓÊÏäÕ ......
н¨Êý¾Ý±íÒÔºó£¬ÈôÔÙ¶Ô¸Ã±í½øÐиü¸Ä£¬Ôò»á³öÏÖ¾¯¸æÐÅÏ¢“²»ÔÊÐí±£´æ¸ü¸Ä ×èÖ¹±£´æÒªÇóÖØÐ´´½¨±íµÄ¸ü¸Ä”£¬µÈµÈ£¬ÐèÒª½øÐÐÒ»ÏÂÉèÖ㺹¤¾ß--->Ñ¡Ïî--->Designers--->±íÉè¼ÆÆ÷ºÍÊý¾Ý¿âÉè¼ÆÆ÷--->×éÖ¯±£´æÒªÇóÖØÐ´´½¨±íµÄ¸ü¸Ä£¬È¥µô¸´Ñ¡¿ò¡£
À´Ô´ÍøÂ磺“²»ÊǺÜÀí½âΪʲôÔÚ2008Öлá¼ÓÈë"×èÖ¹ ......
½ñÌìÅöµ½Ò»¸ösql:0206nµÄ´íÎó£¬ÎÒʹÓÃselect * from xxx¿ÉÒԲ鿴±í½á¹¹ºÍÄÚÈÝ£¬È»¶øµ±ÎÒʹÓÃselect aaa from xxxµÄʱºòÈ´¸øÎÒ±¨´í£¬×îºóÅŲéÔÒòÊÇÎÒʹÓù¤¾ß½¨±í£¬½¨±íÓï¾äÊÇÀàËÆÕâÑùµÄ£ºcreate table("id" int,"name" varchar)£¬ºÃÁ˽á¹û¾ÍÊÇ×ֶθø¼ÓÁËÒýºÅ£¬ÔÚ²éѯµÄʱºòʹÓÃ*¿ÉÒÔ²éѯ£¬Ê¹Óõ¥¸ö×ֶβ»Äܲéѯ£¬ÎÒ¹À¼Æ¾ÍÊ ......
ÔÚOracle SQLÖÐÈ¡Êý¾ÝʱÓÐʱҪÓõ½in ºÍ exists ÄÇôËûÃÇÓÐÊ²Ã´Çø±ðÄØ£¿
1 ÐÔÄÜÉϵıȽÏ
±ÈÈçSelect * from T1 where x in ( select y from T2 )
Ö´ÐеĹý³ÌÏ൱ÓÚ:
select *
from t1, ( select distinct y from t2 ) t2
where t1.x = t2.y;
숦﵀
select * from t1 where exists ( select null fro ......