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

SQLServer ±í²éѯÖÐµÄ ºÏ²¢²éѯ ºÏ¼¯ ²î¼¯ ½»¼¯

use tempdb
go
if (object_id ('t1' ) is not null ) drop table t1
if (object_id ('t2' ) is not null ) drop table t2
go
create table t1 (a int )
insert into t1 select 1 union select 2 union select 3
create table t2 (a int )
insert into t2 select 3 union select 4 union select 5
go
select * from t1 union select * from t2
go
/* Çó±íºÏ¼¯
1
2
3
4
5*/
select * from t1 union all   select * from t2
go
/*Çó±íºÏ¼¯²»¹ýÂËÖظ´
1
2
3
3
4
5*/
select * from t1 except select * from t2
go
/*Çót1¶Ôt2µÄ²î¼¯
1
2*/
select * from t1 intersect select * from t2
go
/*Çót1¶Ôt2µÄ½»¼¯
3*/
±¾ÎÄÀ´×ÔCSDN²©¿Í£ºhttp://blog.csdn.net/jinjazz/archive/2009/09/07/4527863.aspx


Ïà¹ØÎĵµ£º

Sqlite»ù´¡¼°ÆäÓëSQLServerÓï·¨²îÒì

sqlite¹Ù·½Õ¾
http://www.sqlite.org/
SQL Syntax
http://www.sqlite.org/lang.html
sqliteÖÐÎÄÕ¾
http://www.sqlite.com.cn/
http://www.sqlitechina.org/
½¨Á¢Êý¾Ý¿âµµ°¸
ÓÃsqlite3½¨Á¢Êý¾Ý¿âµÄ·½·¨ºÜ¼òµ¥£¬Ö»ÒªÔÚshellϼüÈ루ÒÔÏÂ$·ûºÅΪshellÌáʾºÅ£¬ÇëÎð¼üÈ룩£º
$ sqlite3 foo.db
Èç¹ûĿ¼ÏÂûÓÐfo ......

SQLServerµÄÁ½¸öά»¤¼¼ÇÉ

¡¡È·Êµ£¬Êý¾Ý¿âµÄά»¤³£³£½»¸øÄÇЩרҵµÄÊý¾Ý¿â¹ÜÀíÔ±£¬µ«ÊÇ×÷Ϊһ¸ö¿ª·¢Õߣ¬ÄãÒ²Ðíż¶ûÐèÒªÔÝʱ´ÓÊÂÕâ¸ö¹¤×÷¡£ËùÒÔ£¬ÊÔÒ»ÊÔÕâÁ½¸öSQL·þÎñÆ÷ά»¤¼¼ÇÉ£ºÇáËɸıäÊý¾Ý¿âÓµÓÐÕß¡¢ÕûÀíË÷ÒýËéƬ¡£Ë­»áÏëµ½ÄãÉõÖÁ¿ÉÒÔ¸øÄÇЩÊý¾Ý¿â¹ÜÀíÔ±½ÌÉÏÒ»Á½¸öм¼ÇÉÄØ£¿ÖØÖ¸¶¨Êý¾Ý¿âÓµÓÐÕßµ±»Ø¸´»òÕßн¨Êý¾Ý¿âʱ£¬ÄãÓÐûÓÐ×¢Òâµ½SQL Server° ......

SpringÅäÖõÄMS SQLSERVER 2008 JDBCÁ¬½Ó


  ²»µÃ²»ËµµÄÔÚ MS SQL SERVER Ï嵀 JDBC µ÷ÓÃ
 
½ñÌìÏÂÎ磬ÁÙʱ¾ö¶¨ÒªÔÙ MS SQL-SERVER  ÏÂÅäÖà Spring µÄÊý¾ÝÔ´ DataSource ¡£µ«ÅäÖÃÁË°ëÌì,»ñÈ¡Êý¾ÝÔ´ÈÔ²»³É¹¦£¬ÎÒûÓа취£¬ÕÒÔ­Òòߣ¬Ö»ÄÜд¸öÁÐ×Ó²âÊÔÏ¡£ÏȲ»¹ÜÈýÆ߶þʮһ£¬ÏÈÉÏÕýÈ·µÄÀý×ÓÔÙ˵¡£
¿´¿ÍÈç¹ûÏëÔËÐÐÏÂÃæµÄ´úÂ룬ÐèÒª×Ô¼ºÊÖ¹¤ ......

SqlServer,Oracle ³£Óú¯Êý±È½Ï


SqlServer,Oracle ³£Óú¯Êý±È½Ï
 
Êýѧº¯Êý£º
1.¾ø¶ÔÖµ
¡¡¡¡ Sql Server: SELECT abs(-1) value
¡¡¡¡ Oracle: SELECT abs(-1) value from dual
2.È¡Õû(´ó)
¡¡¡¡ Sql Server: SELECT ceiling(-1.001) value
¡¡¡¡ Oracle: SELECT ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
¡¡¡¡ Sql Server: SELECT f ......

sqlserver dateadd

-- ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ
¼ÓÄê·Ý——print dateadd(year, 5, getdate())       ¼ÓÔ·ݗ—print dateadd(month, 5, getdate())
¼ÓÌìÊý——print dateadd(day, 5, getdate())    ¼ÓСʱ——print dat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ