perlÀûÓÃÄÚ´æʹÓÃsqlÓï¾ä
´ó¼ÒºÃ£¡×î½üÓÖÓÐÁËһЩģ¿éÓ÷¨µÄÐĵã¬ÄǾÍÊÇÀûÓÃÄ£¿éʹÄãµÄÄÚ´æ±ä³ÉÒ»¸öÐéÄâµÄÊý¾Ý¿âģʽ£¬Ê¹Äã¿ÉÒÔÔÚûÓÐÊý¾Ý¿âµÄÇé¿öÏ£¬½«txtÎļþµÄÊý¾Ý½øÐÐ sqlÓï¾ä´¦Àí£¬¸Ð¾õºÜÐÂÏÊ°É£¬²»¹ýÕâ¸ö²»Óøе½¾ªÑÈ£¬PerlÒ»Ö±ÊǺÜÍêÃÀµÄ£¬¹þ¹þ£¬ÄÇÎÒÃǾÍÀ´¿´¿´Õâ¸öÉñÆæ°É£¡
ÐèÒª°²×° Ä£¿é£º
SQl::Library;
DBI
ÏÂÃæÊdzÌÐò(±È½ÏÎļþ1ºÍÎļþ2ÖеĹؼü×ֶΣ¬±ÈÈç¸èÇú±È¸èÇú£¬¸èÊֱȸèÊÖ£¬Èç¹ûÏàͬ¾ÍÊä³ö)£º
#!/usr/bin/perl
use SQl::Library;
use DBI;
my $data1='T';
my $data2='R';
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
$table='students';
$format='Tab'; #ÎļþÊÇÒÔÖƱí·û·Ö¸îµÄ
$file='d:/test.txt'; #Îļþ1
$flags = { col_names => 'a,b,c,d,e,f,g,h'}; #ÎļþÓм¸¸ö±í×Ö¶Î
$dbh->func( $table, $format, $file, $flags, 'ad_import');
$table1='students1';
$format1='Tab'; #ÎļþÊÇÒÔÖƱí·û·Ö¸îµÄ
$file1='d:/test2.txt' #Îļþ2
flags1 = { col_names => 'a,b,c,d,e,f,g,h,i'}; #ÎļþÓм¸¸ö±í×Ö¶Î
$dbh->func( $table1, $format1, $file1, $flags1, 'ad_import');
my $tel_sth=$dbh->prepare("select b.*,a.i from students1 a,students b
where a.f=b.c and a.g=b.d"); #µ÷ÓÃsqlÓï¾äµÄ·½Ê½½øÐвéѯ£¬ÔÚÎÒµÄÊý¾ÝÀïÃæÊÇ ¸èÇúºÍ¸èÊÖ2¸ö×ֶνøÐеIJéѯ
$tel_sth->execute; #Ö´ÐÐÓï¾ä
while (my @ref = $tel_sth->fetchrow_array()) {
chomp(@ref);
my $file_data = join "\t", @ref;
print 'ÕâЩÊý¾ÝÊǸèÇúºÍ¸èÊÖÏàͬµÄ'."$file_data\n"
}
ÕâÑù¾Í¿ÉÒÔºÜÇáËɵĽ«Êý¾Ý½øÐÐÕûÀíÁË£¬¶ÔÓÚÓÐʱºòÎÞ·¨Ê¹ÓÃÊý¾Ý¿â½øÐд¦ÀíµÄʱºòÕâÊǸö²»´íµÄÑ¡Ôñ¡£
µ«ÊÇ»¹ÊÇÐèÒªÉæ¼°µ½ÐÔÄÜÎÊÌâµÄ£¬ÒòΪÕâÊǸöÄ£·ÂÊý¾Ý¿âÔÚÄÚ´æÉϽøÐеIJÙ×÷£¬ÔÚËÙ¶ÈÉÏÃæÊDz»¿ÉÄܺÍÊý¾Ý¿âµÄÏà±È£¬¶øÇÒÕ¼ÓÃ×ÊÔ´±È½Ï´ó£¬µ±ÄãµÄÎļþºÜ´óµÄʱºò£¬¿ÉÄܸù±¾¾ÍûÓа취ȥÔËÐÐÁË£¬Òò´ËÖ»ÊʺÏÊý¾ÝÁ¿±È½ÏСµÄÀ´ÔËÓÃÁË£¬¿ÉÒÔ¿´×Ô¼ºµÄÄÚ´æºÍÊý¾ÝµÈÀ´ºÏÀíÔËÓÃÁË°¡£¬¾Í˵µ½×ÅÁË¡£
Ïà¹ØÎĵµ£º
¿Î³Ì¾Å ÉùÃ÷±äÁ¿
¡¡¡¡
¡¡¡¡±¾¿ÎÖص㣺
¡¡¡¡1¡¢Á˽â»ù±¾µÄPLSQL¿éºÍÇøÓò
¡¡¡¡2¡¢ÃèÊö±äÁ¿ÔÚPLSQLÖеÄÖØÒªÐÔ
¡¡¡¡3¡¢Çø±ðPLSQLÓë·ÇPLSQL±äÁ¿
¡¡¡¡4¡¢ÉùÃ÷±äÁ¿
¡¡¡¡5¡¢Ö´ÐÐPLSQL¿é
¡¡¡¡
¡¡¡¡×¢Ò⣺ÒÔÏÂʵÀýÖбêµã¾ùΪӢÎÄ°ë½Ç
¡¡¡¡
¡¡¡¡Ò»¡¢¸ÅÊö£º
¡¡¡¡1¡¢PLSQL ¿é½á¹¹£º
¡¡¡¡DECLARE --- ¿ÉÑ¡
¡¡¡¡±äÁ¿Éù ......
Ç°¶Îʱ¼ä °Ñ֮ǰµÄÎÞÏÞ·Ö¼¶±íÉÔ΢×öÁËһЩ¸Ä½ø ¸Ä½øºóµÄ±í½á¹¹ÈçÏÂ
ID Name ParentID ParentIDList level
1 A 0 0-1 &nbs ......
Microsoft SQL Server ±í²»Ó¦¸Ã°üº¬Öظ´ÐкͷÇΨһÖ÷¼ü¡£Îª¼ò½àÆð¼û£¬ÔÚ±¾ÎÄÖÐÎÒÃÇÓÐʱ³ÆÖ÷¼üΪ“¼ü”»ò“PK”£¬µ«ÕâʼÖÕ±íʾ“Ö÷¼ü”¡£Öظ´µÄ PK Î¥·´ÁËʵÌåÍêÕûÐÔ£¬ÔÚ¹ØϵϵͳÖÐÊDz»ÔÊÐíµÄ¡£SQL Server Óи÷ÖÖÇ¿ÖÆÖ´ÐÐʵÌåÍêÕûÐԵĻúÖÆ£¬°üÀ¨Ë÷Òý¡¢Î¨Ò»Ô¼Êø¡¢Ö÷¼üÔ¼Êøº ......
[¿ÉÓÃ]Èç¹û³öÏÖ°²×°sql server 2000ÒªÇóCD-KEYµÄÇé¿ö,ÇëʹÓÃregedt32ÕÒ¿ª×¢²á±í,ÔÚÒÔÏÂÖ÷¼ü[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager]Öн¨Á¢Ò»¸öDWORD¼ü
SafeDLLSearchMode²¢ÉèֵΪ0
Õâ¸öÊÔ¹ý£¬ÊÇ¿ÉÒÔÓõÄ
H6TWQ-TQQM8-HXJYG-D69F7-R84VM - ......
--ºÏ²¢Öظ´ÐÐ
select * from A
union
select * from B
--²»ºÏ²¢Öظ´ÐÐ
select * from A
union all
select * from B
°´Ä³¸ö×Ö¶ÎÅÅÐò
--ºÏ²¢Öظ´ÐÐ
select *
from (
select * from A
union
select * from B) AS T
order by ×Ö¶ÎÃû
--²»ºÏ²¢Öظ´ÐÐ
select *
from (
select * from A
union all
select * ......