SQL¡¢PL/SQLѧϰ±Ê¼Ç
1£®SQL²¢Ðвéѯ
alter session enable parallel dml execute immediate 'alter session enable parallel dml'; --Ð޸ĻỰ²¢ÐÐDML select /*+parallel(a,4)*/ * from table_name a select /*+parallel(a,8)*/ * from table_name a select /*+parallel(a,4) parallel(b,4) parallel(c,4)*/ a.*,b.*,c.* from table_name<st1:chmetcnv w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0"><st1:address w:st="on" unitname="a" sourcevalue="1" hasspace="True" negative="False" numbertype="1" tcsc="0">1 a</st1:address></st1:chmetcnv>,table_name2 b,table_name c insert /*+parallel(t,4)*/ into table_name t insert /*+parallel(t,8)*/ into table_name t /*+parallel(t,8)*/ ²¢Ðд¦Àí£¬Ò»°ãΪCPUµÄ±¶ÊýÈ磺4£¬8µÈ,ÔÚÖ´ÐÐÀàÐÍSQL±ØÐëÏÈÔËÐÐ:alter session enable parallel dml
2£®É¾³ý±í·ÖÇøÊý¾Ý
alter table masamk.tb_mk_sc_user_mon truncate partition mk_user_mon_'||trim(iv_month) ɾ³ýÖ¸¶¨±í·ÖÇøÊý¾Ý
3£®minus(²î¼¯)Óëintersect(½»¼¯)
minus Ö¸ÁîÊÇÔËÓÃÔÚÁ½¸ö SQL Óï¾äÉÏ¡£ËüÏÈÕÒ³öµÚÒ»¸ö SQL Óï¾äËù²úÉúµÄ½á¹û£¬È»ºó¿´ÕâЩ½á¹ûÓÐûÓÐÔÚµÚ¶þ¸ö SQL Óï¾äµÄ½á¹ûÖÐ,Èç¹ûÓеĻ°£¬ÄÇÕâÒ»±Ê×ÊÁϾͱ»È¥³ý£¬¶ø²»»áÔÚ×îºóµÄ½á¹ûÖгöÏÖ; Èç¹ûµÚ¶þ¸ö SQL Óï¾äËù²úÉúµÄ½á¹û²¢Ã»ÓдæÔÚÓÚµÚÒ»¸ö SQL Óï¾äËù²úÉúµÄ½á¹ûÄÚ£¬ÄÇÕâ±Ê×ÊÁϾͱ»Å×Æú¡£ intersect Ö¸ÁîÊÇÔËÓÃÔÚÁ½¸öSQLÓï¾äÉÏ£¬Èç¹ûÁ½¸öSQLÓï¾äµÄ¼Ç¼ÍêÈ«ÏàͬÔòÏÔʾÏàÓ¦¼Ç¼£¬·ñÔò½«²»ÔÚ½á¹ûÖгöÏÖ
4£®Order by ÖÐµÄ nulls last
order by area_code,bill_month nulls last --nulls last ½«ÅÅÐò×Ö¶ÎΪnull¼Ç¼·ÅÔÚ×îºóÃæ
5£®nvlµÄ¼¸¸ö²»Í
Ïà¹ØÎĵµ£º
ÔÚwindows2003ÏÂÃæ°²×°SQL Server2000£¬»áÌáʾwindows²»Ö§³ÖSQL Server2000µÄ°æ±¾£¬°²×°ºó£¬ÔÚ±¾»úÊÇ¿ÉÒÔÕý³£Ê¹Óõģ¬µ«ÊÇÎÞ·¨Á¬½Óµ½ÆäËûSQL Server2000µÄ·þÎñÆ÷£¬Ò²ÎÞ·¨Í¨¹ýÆäËû»úÆ÷ÉϵÄSQL Server2000·ÃÎÊ£¬±ØÐë°²×°SQL Server2000sp3»òsp4²¹¶¡²Å¿ÉÒÔ¡£ÆäʵÓÃSQL Server2005¾ÍûÕâôÂé·³ÁË¡£ ......
ÏÖÔÚLinq to sqlµÄ×ÊÁÏ»¹²»ÊǺܶ࣬±¾ÈËˮƽÓÐÏÞ£¬Èç¹ûÓдí»òÕßÎóµ¼ÇëÖ¸³ö£¬Ð»Ð»¡£
Ò»²½Ò»²½Ñ§Linq to sql£¨Ò»£©£ºÔ¤±¸ÖªÊ¶
Ò»²½Ò»²½Ñ§Linq to sql£¨¶þ£©£ºDataContextÓëʵÌå
Ò»²½Ò»²½Ñ§Linq to sql£¨Èý£©£ºÔöɾ¸Ä
Ò»²½Ò»²½Ñ§Linq to sql£¨ËÄ£©£º²éѯ¾ä·¨
Ò»²½Ò»²½Ñ§Linq to sql£¨Î壩£º´æ´¢¹ý³Ì
Ò»²½Ò»²½ ......
SQLÓï¾äÏÈǰдµÄʱºò£¬ºÜÈÝÒ×°ÑһЩÌØÊâµÄÓ÷¨Íü¼Ç£¬ÎÒÌØ´ËÕûÀíÁËÒ»ÏÂSQLÓï¾ä²Ù×÷¡£
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssq ......
The following tables describe certain SQL
limits. Adhering to the most restrictive case can help the programmer
design application programs that are easily portable.
Table 7. Identifier Length Limits
Description
Limit in Bytes
Longest authorization
name (can only be single-byte characters) ......