ѧϰ T SQL (1)
»ùÓÚmsdn ÏêϸѧϰT-SQL (http://msdn.microsoft.com/zh-cn/library/bb510741.aspx)
Aggregate function--Sum() Two Sample from msdn
USE AdventureWorks;
GO
SELECT Color, SUM(ListPrice), SUM(StandardCost)
from Production.Product
WHERE Color IS NOT NULL
AND ListPrice != 0.00
AND Name LIKE 'Mountain%'
GROUP BY Color
ORDER BY Color;
GO
USE AdventureWorks;
GO
SELECT Color, ListPrice, StandardCost
from Production.Product
WHERE Color IS NOT NULL
AND ListPrice != 0.00
AND Name LIKE 'Mountain%'
ORDER BY Color
COMPUTE SUM(ListPrice), SUM(StandardCost) BY Color;
GO
Ïà¹ØÎĵµ£º
¡¾1¡¿
create procedure proc_pager1
( @pageIndex int, -- ҪѡÔñµÚXÒ³µÄÊý¾Ý
@pageSize int -- ÿҳÏÔʾ¼Ç¼Êý
)
AS
BEGIN
declare @sqlStr varchar(500)
set @sqlStr='select top '+con ......
Microsoft Access Êý¾ÝÀàÐÍ
Êý¾ÝÀàÐÍ
ÃèÊö
´æ´¢
Text
ÓÃÓÚÎı¾»òÎı¾ÓëÊý×ÖµÄ×éºÏ¡£×î¶à 255 ¸ö×Ö·û¡£
Memo
Memo ÓÃÓÚ¸ü´óÊýÁ¿µÄÎı¾¡£×î¶à´æ´¢ 65,536 ¸ö×Ö·û¡£
×¢ÊÍ£ºÎÞ·¨¶Ô memo ×ֶνøÐÐÅÅÐò¡£²»¹ýËüÃÇÊÇ¿ÉËÑË÷µÄ¡£
Byte
ÔÊÐí 0 µ½ 255 µÄÊý×Ö¡£
1 ×Ö½Ú
Integer
ÔÊÐí½éÓÚ -32,768 µ½ 32 ......
ÔÚWhere×Ó¾äÖУ¬¿ÉÒÔ¶Ôdatetime¡¢char¡¢varchar×Ö¶ÎÀàÐ͵ÄÁÐÓÃLike×Ó¾äÅäºÏͨÅä·ûÑ¡È¡ÄÇЩ“ºÜÏñ...”µÄÊý¾Ý¼Ç¼£¬ÒÔÏÂÊÇ¿ÉʹÓõÄͨÅä·û£º
% Áã»òÕ߶à¸ö×Ö·û
_ µ¥Ò»ÈκÎ×Ö·û£¨Ï»®Ïߣ©
\ ÌØÊâ×Ö·û
[] ÔÚijһ·¶Î§ÄÚµÄ×Ö·û£¬Èç ......
C#ÖÐÒÔwindowsÑéÖ¤·½Ê½Á¬½ÓSQL serverÊý¾Ý¿âµÄÀà¡£ºÜ¶àÈËÁ¬½ÓÊý¾Ý¿âʱ¿ÉÄܶ¼ÊÇÍøÉϲéÁËÈ»ºó¾ÍÁ¬ÁË£¬¶ÔÓÚ²ÎÊýµÄº¬Òåµ¹ÊÇûÔõôÔÚÒ⣬żҲÊÇ£¨ºÇºÇ£©£¬µ±È»ÎÒÃǶ¼×¢Öؽá¹ûÂ¿ÉÊÇÕâÑù²»ÈÝÒ×¼ÇÒäÿ´ÎÁ¬µÄʱºò¶¼ÊÇÉÏÍø²é£¬¸Ð¾õͦ²»·½±ã£¬ËùÒÔË÷ÐÔ²éÁËһϡ£~~~Integrated Security=True£»±íʾÔÚÁ¬½ÓÊý¾Ý¿â½øÐÐÉí·ÝÑé֤ʱÓÃwind ......
1 ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£© #region ·ÀÖ¹sql×¢Èëʽ¹¥»÷(¿ÉÓÃÓÚUI²ã¿ØÖÆ£©
2
3 /**/ ///
4 /// ÅжÏ×Ö·û´®ÖÐÊÇ·ñÓÐSQL¹¥»÷´úÂë
5 ///
6 /// ´«ÈëÓû§Ìá½»Êý¾Ý
7 /// ......