SQLº¯Êý´óÈ«
Ò»¡¢ÄÚ²¿º¯Êý
1¡¢ÄÚ²¿ºÏ¼Æº¯Êý
1£©COUNT£¨*£© ·µ»ØÐÐÊý
2£©COUNT£¨DISTINCT COLNAME£©·µ»ØÖ¸¶¨ÁÐÖÐΨһֵµÄ¸öÊý
3£©SUM£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽµÄÊýÖµºÍ£»
4£©SUM£¨DISTINCT COLNAME£© ·µ»ØÖ¸¶¨ÁÐÖÐΨһֵµÄºÍ
5£©AVG£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽÖеÄÊýֵƽ¾ùÖµ
6£©AVG£¨DISTINCT COLNAME£© ·µ»ØÖ¸¶¨ÁÐÖÐΨһֵµÄƽ¾ùÖµ
7£©MIN£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽÖеÄÊýÖµ×îСֵ
8£©MAX£¨COLNAME/EXPRESSION£©·µ»ØÖ¸¶¨Áлò±í´ïʽÖеÄÊýÖµ×î´óÖµ
2¡¢ÈÕÆÚÓëʱ¼äº¯Êý
1£©DAY£¨DATE/DATETIME EXPRESSION£©·µ»ØÖ¸¶¨±í´ïʽÖеĵ±Ô¼¸ºÅ
2£©MONTH£¨DATE/DATETIME EXPRESSION£© ·µ»ØÖ¸¶¨±í´ïʽÖеÄÔ·Ý
3£©YEAR£¨DATE/DATETIME EXPRESSION£©·µ»ØÖ¸¶¨±í´ïʽÖеÄÄê·Ý
4£©WEEKDAY£¨DATE/DATETIME EXPRESSION£© ·µ»ØÖ¸¶¨±í´ïʽÖеĵ±ÖÜÐÇÆÚ¼¸
5£©DATE£¨NOT DATE EXPRESSION£©·µ»ØÖ¸¶¨±í´ïʽ´ú±íµÄÈÕÆÚÖµ
6£©TODAY ·µ»Øµ±Ç°ÈÕÆÚµÄÈÕÆÚÖµ
7£©CURRENT[FIRST TO LAST] ·µ»Øµ±Ç°ÈÕÆÚµÄÈÕÆÚʱ¼äÖµ
8£©COLNAME/EXPRESSION UNITS PRECISION ·µ»ØÖ¸¶¨¾«¶ÈµÄÖ¸¶¨µ¥Î»Êý
9£©MDY£¨MONTH£¬DAY£¬YEAR£© ·µ»Ø±êʶָ¶¨Äê¡¢Ô¡¢ÈÕµÄÈÕÆÚÖµ
10£©DATETIME£¨DATE/DATETIME EXPRESSION£©FIRST TO LAST ·µ»Ø±í´ïʽ´ú±íµÄÈÕÆÚʱ¼äÖµ
11£©INTERVAL£¨DATE/DATETIME EXPRESSION£©FIRST TO LAST ·µ»Ø±í´ïʽ´ú±íµÄʱ¼ä¼ä¸ôÖµ
12£©EXTEND£¨DATE/DATETIME EXPRESSION£¬[FIRST TO LAST]£©·µ»Ø¾¹ýµ÷ÕûµÄÈÕÆÚ»òÈÕÆÚʱ¼äÖµ
To_charº¯Êý½«datetimeºÍdateֵת»¯Îª×Ö·ûÖµ¡£
To_dateº¯Êý½«×Ö·ûֵת»¯ÎªdatetimeÀàÐ͵ÄÖµ¡£Àýto_date(“1978-10-07 10:00” ,”%Y-%m-%d %H:%M)
Àý×Ó1¡¢ºÍUNITSºÏÓã¬Ö¸¶¨ÈÕÆÚ»òʱ¼äµ¥Î»(year,month,day,hour,minute,seond,fraction)£º
let tmp_date = today + 3 UNITS day
Àý×Ó2¡¢let tmp_date = MDY(10,30,2002) -- 2002-10-30
Àý×Ó3¡¢let tmp_date = today + interval(7) day to day --µ±Ç°Ê±¼ä¼ÓÉÏ7Ì죻
×¢£º¸Ã¹¦ÄÜÓë1ÏàËÆ£»
Àý×Ó4¡¢EXTENDת»»ÈÕÆÚ»òÈÕÆÚʱ¼äÖµ
let tmp_inthour = extend(datetime1,hour to hour)
3¡¢´úÊýº¯Êý
1£©ABS(COLNAME/EXPRESSION)£º È¡¾ø¶ÔÖµ
2£©MOD£¨COLNAME/EXPRESSION£¬DIVISOR£© ·µ»Ø³ýÒÔ³ýÊýºóµÄÄ££¨ÓàÊý£©
3£©POW£¨COLNAME/EXPRESSION£¬EXPONENT£© ·µ»ØÒ»¸öÖµµÄÖ¸ÊýÚ¤
Àý×Ó£ºlet tmp_float = pow(2
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
д³É´æ´¢¹ý³Ì£¬½¨Á¢×÷Òµ¶¨Ê±±¸·Ý~~~
--ÔÚsqlÖÐÓ³ÉäһϾͿÉÒÔÁË
exec master..xp_cmdshell 'net use z: \\yizhi\D$ "ÃÜÂë" /user:yizhi\administrator'
/*--˵Ã÷:
exec master..xp_cmdshell 'net use z: \\xz\c$ "ÃÜÂë" /user:xz\administrator'
z:ÊÇÓ³ÉäÍøÂç·¾¶¶ÔÓ¦±¾»úµÄÅÌ·û,ÓëÏÂÃæµÄ±¸·Ý¶ÔÓ¦
\\xz\c$ÊÇÒªÓ³ÉäµÄÍ ......
ËùνÊÓͼ£¨View£©ÆäʵÊÇÖ´ÐвéѯÓï¾äºóµÃµ½µÄ½á¹û£¬µ«Õâ¸ö²éѯ½á¹û¿ÉÒÔ·ÂÕæ³ÉÊý¾Ý±íÀ´Ê¹Óã¬ËùÒÔÓÐÈËÒ²³ÆËüΪ“ÐéÄâÊý¾Ý±í”£¬ÊÓͼÔÚ²Ù×÷ÉϺÍÊý¾Ý±íûÓÐʲôÇø±ð£¬µ«Á½ÕߵIJîÒìÊÇÆä±¾ÖÊÊDz»Í¬µÄ£ºÊý¾Ý±íÊÇʵ¼Ê´æ´¢¼Ç¼µÄµØ·½£¬È»¶øÊÓͼ²¢²»±£´æÈκμǼ£¬Ëü´æ´¢µÄʵ¼ÊÉÏÊDzéѯÓï¾ä£¬ÆäËù³ÊÏÖ³ ......
//±¾³ÌÐòÁ¬½ÓµÄÊÇsql server 2005£¬ÓëÁ¬½Ósql server 2000Óе㲻ͬ£ºdriverNameºÍURL¶¼²»Í¬
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class create{
public void getConnection() th ......