ÇóÒ»¸öSQLÓï¾ä - MS-SQL Server / Ó¦ÓÃʵÀý
Êý¾Ý¿â±íCustomerNote£¨°Ý·Ã±í£©ÖÐÓÐÒ»×Ö¶Îvisittime£¨Ê±¼ä£©¡£ÄÜ·ñÓÃÒ»ÌõÓï¾ä²é³ö1£¬2£¬3£¬4£¬¡£¡£¡£¡£12ÔµļǼ
ÎÒÏë¿´µ½1ÔÂÖаݷÃÁËË£¬2Ô°ݷÃÁËË¡£¡£¡£
SQL code:
where month(visittime)=1
where year(visittime)=2010 and month(visittime)=1
µ±È»¿ÉÒÔ...
Ö»ÒªÄÜÏëµ½£¬¾ÍûÓв鲻µ½µÄ...
ÕâÑùµÄÓï¾äÊÇҪд12´ÎÂð£¿
SQL code:
--1
where year(visittime)=2010 and month(visittime)=1
--2
where convert(varchar(7),visittime,120)='2010-01'
ÒªÐÐÁÐת»»Âð
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......
tab1 ×Ö¶Î:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 ×Ö¶Î:goodsid,goodskind£¨ÉÌÆ·ÀàÐÍ£©
tab3 ×Ö¶Î:goodskind£¨ÉÌÆ·ÀàÐÍ£©,kindname
½á¹û£º
µÃµ½ÉÌÆ·ÀàÐÍÔÚÒ»¶Îʱ¼ä ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......