Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL×Ô´øµÄһЩº¯Êý

Copy ÒÔÏÂÄÚÈݵ½²éѯ·ÖÎöÆ÷²Ù×÷£º
-- 3 ****************************************************
-- ÊìϤϵͳ×Ô´øµÄһЩº¯Êý
-- 3.1 --------------------------------------------------
-- Êýѧº¯Êý
-- ABS(num_expression)          ·µ»Ø¸ø¶¨ÊýÖµ±í´ïʽµÄ¾ø¶ÔÖµ
-- CEILING(num_expression)      ·µ»Ø´óÓÚ»òµÈÓÚ¸ø¶¨ÊýÖµ±í´ïʽµÄ×îСÕûÊý
-- ROUND(num_expression,length) ·µ»ØËÄÉáÎåÈëµ½Ö¸¶¨³¤¶È»ò¾«¶ÈµÄÊýÖµ±í´ïʽ£¨µ± length ΪÕýʱ£¬ËÄÉáÎåÈëΪ length ËùÖ¸¶¨µÄСÊýλÊý£»µ± length Ϊ¸ºÊ±£¬ÔÚСÊýµãµÄ×ó±ßËÄÉáÎåÈ룩
-- /                            È¡Ä£
-- %                            È¡Óà
-- RAND()                       »ñµÃֵΪ 0-1 Ö®¼äµÄËæ»ú¸¡µãÖµ
select abs(5),abs(-5)
select ceiling(3.14),ceiling(3)
select round(748.981,-4) as '-4',round(748.981,-3) as '-3',round(748.981,-2) as '-2',round(748.981,-1) as '-1'
      ,round(748.981,0) as '0',round(748.981,1) as '1',round(748.981,2) as '2',round(748.981,3) as '3'
select 7/3
select 7%3
select rand()
-- 3.2 --------------------------------------------------
-- ¾ÛºÏº¯Êý
-- MIN()    Çó×îСֵ
-- AVG()    Çóƽ¾ùÖµ
-- MAX()    Çó×î´óÖµ
-- SUM()    ÇóºÍ
-- COUNT(*) ÇóÑ¡¶¨µÄÐÐÊý
select min(UnitPrice) as min,avg(UnitPrice) as avg,max(UnitPrice) as max from Northwind..Products
select count(*) from Northwind..[Order Details] where OrderID = 10248
-- 3.3 --------------------------------------------------
-- ×Ö·û´®º¯Êý
-- LEN(string_expression)           &nb


Ïà¹ØÎĵµ£º

Sql Server »ñÈ¡¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý ×Ö¶ÎÃèÊö

»ñÈ¡¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ýsqlserver×Ö¶ÎÃèÊö
Select o.name AS tableName, c.name AS columnName, p.[value] AS Description  
from sysproperties p INNER JOIN  
      sysobjects o ON o.id = p.id INNER JOIN  
      syscolumn ......

Îı¾µÄµ¼Èëµ¼³öºÍSQL½Å±¾µÄÖ´Ðз½·¨


Ò».Îı¾µ¼ÈëÊý¾Ý¿â
--²½Öè1.´´½¨¿ØÖÆÎļþ
load data¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --1¡¢¿ØÖÆÎļþ±êʶ
infile 'E:\oradata\orcl\test\inf_user.txt'¡¡¡¡¡¡¡¡¡¡¡¡¡¡ --2¡¢ÒªÊäÈëµÄÊý¾ÝÎļþÃûΪinf_user.txt   (Îļþȱʡ·Åµ½C:\ Ï£¬Èç¹û²»ÊÇ£¬¾ÍÐèÒªÖ¸Ã÷ȫ·¾¶)
append into table inf_user¡¡¡¡¡¡¡¡--3¡¢Ïò±ítestÖÐ× ......

SQL Server ÃæÊÔÌâ

Sql³£¼ûÃæÊÔÌ⣨×ܽᣩ
0.ÈçºÎɾ³ýÒ»¸öÓµÓбȽ϶àµÄÊý¾ÝµÄ±í
Èç¹û¸Ã±íËùÔÚµÄÊý¾Ý¿âÓµÓнÏÉÙµÄ±í£¬¿ÉÒÔÏȽ«ÆäÓà±íµ¼³öÈ¥£¬È»ºó·ÖÀëÊý¾Ý¿â£¬ÔÚɾ³ý£¬Ð½¨Ò»¸öͬÃûÊý¾Ý¿â£¬½«ÆäÓà±íÔٴε¼Èë¡£
1.ÓÃÒ»ÌõSQLÓï¾ä ²éѯ³öÿÃſζ¼´óÓÚ80·ÖµÄѧÉúÐÕÃû  
name kecheng fenshu
ÕÅÈý     ÓïÎÄ  &n ......

һЩ¾­µäµÄSQLÓï¾ä

ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE data ......

c#sql server


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using AHUT_TetWebERP;
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ