ÀûÓÃpl/sqlÖ´Ðб¾µØµÄsqlÎļþÖеÄsqlÓï¾ä
¹¦ÄÜ£ºpl/sqlÖ´Ðб¾µØµÄsqlÎļþÖеÄsqlÓï¾ä
˵Ã÷£º±ÈÈ磺e:\zhaozhenlongÏÂÓÐcreate_table.sqlÎļþ£¬Ôò°´ÈçÏ·½·¨Ö´ÐУº
²½Ö裺
1¡¢ÔÚpl/sqlµÄcommand windowÏ£¬
»òÔÚwindowsµÄ¿ªÊ¼/'ÔËÐÐ'Ï£¬sqlplus /nolog; connect cs@orademo;
2¡¢Ö´ÐУº
@@e:\zhaozhenlong\drop_table.sql
@@e:\zhaozhenlong\create_table.sql
/*
˵Ã÷£º.sqlÎļþÃû×ÖÖв»ÄÜÓпոñ£¬
Èçcreate_table.sqlÊǺϷ¨µÄ£¬create table.sqlÊÇ·Ç·¨µÄ¡£
ÎļþÄÚÈÝ:
drop_table.sqlÎļþÄÚÈÝ£º
drop table tb_zhaozhenlong6;
drop table tb_zhaozhenlong5;
create_table.sqlÎļþÄÚÈÝ£º
--drop table tb_zhaozhenlong5;
create table tb_zhaozhenlong5(
c1 varchar2(10) not null constraint pk_zhaozhenlong5 primary key,
c2 varchar2(10) not null ,
c3 varchar2(10) not null constraint un_zhaozhenlong5 unique,
c4 char(1) not null constraint ck_zhaozhenlongddd check(c4 in('0','1')) ,
c5 char(1) not null,
constraint un_zhaozhenlong51 unique(c1,c2),
constraint ch_zhaozhenlong51 check(c5 in('Y','N'))
);
--drop table tb_zhaozhenlong6;
create table tb_zhaozhenlong6(
c1 varchar2(10) not null, constraint fk_zhaozhenlong6 foreign key(c1) references tb_zhaozhenlong5(c1),
c2 varchar2(10) not null,
&nb
Ïà¹ØÎĵµ£º
SQL Server ¼¸¸öºÃÓõÄSQLÓï¾ä
1¡¢¸´ÖƱí
select * into desttable from srctable
½« srctable ÍêÕûµØ¸´ÖÆÒ»·Ýµ½ desttable ÖУ¬µ±È»ºóÃæÒ²¿ÉÒÔ¼ÓÉÏÌõ¼þÀ´ÏÞ¶¨ÐèÒª¸´ÖƵļǼ
ÒªÇó£ºdesttable ±ØÐëΪ²»´æÔڵıíÃû¡£
insert into desttable(column1, column2) select columna, columnb from sr ......
Öª: ×Ö¶ÎA='F:\photo\Winter Leaves.jpg'
ÒªÇó:·Ö¶Î½ØÈ¡Ã¿¶Î×Ö·û[×Ö¶ÎA²»ÄÜΪTEXTÀàÐÍ,·ñÔò±¨´í]
½â¾ö·½·¨:
---½ØÈ¡×Ö·û´®AµÄµÚÒ»¸ö\×ó±ßµÄ×Ö·û´®
select left(A,charindex('/',A)-1)
Êä³ö½á¹û£ºF:
---½ØÈ¡\ÖмäµÄ×Ö·û´®
select left(stuff(A,1,charindex('/',A),''),charindex('/',stuff(A,1,c ......
Ò»¡¢Ê²Ã´ÊÇSQL×¢Èëʽ¹¥»÷£¿
ËùνSQL×¢Èëʽ¹¥»÷£¬¾ÍÊǹ¥»÷Õß°ÑSQLÃüÁî²åÈëµ½Web±íµ¥µÄÊäÈëÓò»òÒ³ÃæÇëÇóµÄ²éѯ×Ö·û´®£¬ÆÛÆ·þÎñÆ÷Ö´ÐжñÒâµÄSQLÃüÁî¡£ÔÚijЩ±íµ¥ÖУ¬Óû§ÊäÈëµÄÄÚÈÝÖ±½ÓÓÃÀ´¹¹Ô죨»òÕßÓ°Ï죩¶¯Ì¬SQLÃüÁ»ò×÷Ϊ´æ´¢¹ý³ÌµÄÊäÈë²ÎÊý£¬ÕâÀà±íµ¥ÌرðÈÝÒ×Êܵ½SQL×¢Èëʽ¹¥»÷¡£³£¼ûµÄSQL×¢Èëʽ¹¥»÷¹ý³ÌÀàÈ磺
¢Å ......
µ½½ñÌìΪֹ£¬ÈËÃǶԹØÏµÊý¾Ý¿â×öÁË´óÁ¿µÄÑо¿£¬²¢¿ª·¢³ö¹ØÏµÊý¾ÝÓïÑÔ£¬Îª²Ù×÷¹ØÏµÊý¾Ý¿âÌṩÁË·½±ãµÄÓû§½Ó¿Ú¡£¹ØÏµÊý¾ÝÓïÑÔĿǰÓм¸Ê®ÖÖ£¬¾ßÓÐÔö¼Ó¡¢É¾³ý¡¢Ð޸ġ¢²éѯ¡¢Êý¾Ý¶¨ÒåÓë¿ØÖÆµÈÍêÕûµÄÊý¾Ý¿â²Ù×÷¹¦ÄÜ¡£Í¨³£°ÑËüÃÇ·ÖΪÁ½Àࣺ¹ØÏµ´úÊýÀàºÍ¹ØÏµÑÝËãÀà¡£
ÔÚÕâЩÓïÑÔÖУ¬½á¹¹»¯²éѯÓïÑÔSQLÒÔÆäÇ¿´óµÄÊý¾Ý¿â²Ù× ......