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

ÎÄ˼´´ÐµÄSQL±ÊÊÔÌâ


ÌâÄ¿£ºÓÐAºÍBÁ©¸ö±í£¬¶¼¶¨ÒåÏàͬµÄÖ÷¼ü£¬Ð´³öSQLÓï¾äÕÒ³öA±íÖÐÓжøB±íÖÐûÓеļǼ£¬È»ºó°ÑûÓеļǼ²åÈëµ½B±íÖС£
SQLÓï¾äÈçÏ£º
CREATE TABLE  A_MINUS_B  AS              ---´´½¨Ò»¸ö²î¼¯±íA_MINUS_B ,×¢ÒâSELECT Óï¾äÒ»¶¨ÒªA±íÔÚǰ¡£
SELECT * from A 
MINUS
SELECT * from B
INSERT INTO B(field1,field2,........)       ----°Ñ²î¼¯²åÈëB±í£¬×¢Òâ²åÈëµÄ×Ö¶Î˳ÐòÒªÏàͬ£¬Êý¾ÝÀàÐÍÒ²ÒªÏàͬ¡£
SELECT field1,field2......
from A_MINUS_B
ÉÏÃæÓï¾äÔÚORACLE 10G ÒÔDEPT±íΪÊÔÑéÖ´Ðгɹ¦¡£Ò²¿ÉÄÜÓиü¸ßЧµÄ°ì·¨£¬´ó¼ÒÒ»ÆðÀ´ÌÖÂÛ¡£¿ÉÓÃÓαêÀ´´¦Àí°É£¬ÎÒ»¹Ã»Ñ§µ½Õⲿ·Ö¡£ÒÔºóÓÐÎһᲹÉÏ£¬µ±È»¸÷λ´óÏÀÒ²¿ÉÏÈдÉÏÁË¡£
insert into B select * from A where not exists(select 1 from B where B.KEYWORD = A.KEYWORD)


Ïà¹ØÎĵµ£º

sqlǶÌײéѯ

select * from sq_donglong.achi_news where ID in (select ID from (select top 6 ID from sq_donglong.achi_news where SortID=82)a union all select ID from (select top 6 ID from sq_donglong.achi_news where SortID=84)b)
......

ruby Á¬½Ó²Ù×÷ sql2005


The following is improved version of the code created by David Mullet, from
http://rubyonwindows.blogspot.com/2007/03/ruby-ado-and-sqlserver.html
require 'win32ole'
class SqlServer
# This class manages database connection and queries
attr_accessor :connection, :data, :fields
attr_wr ......

SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì


SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì
 
·¢²¼Ê±¼ä£º2008.07.11 09:00     À´Ô´£ºÈüµÏÍø    ×÷ÕߣºÐ¡ÇÇ
¡¾ÈüµÏÍø£­IT¼¼Êõ±¨µÀ¡¿SQL Serverµ¼³ö±íµ½EXCELÎļþµÄ´æ´¢¹ý³Ì:
*--Êý¾Ýµ¼³öEXCEL
 
µ¼³ö±íÖеÄÊý¾Ýµ½Excel,°üº¬×Ö¶ÎÃû,ÎļþÎªÕæÕýµÄExcelÎļþ
,Èç¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ