sql ±¸Íü
**************************************
**** sql ²éѯ±¸Íü ****
**************************************
Ò»£ºÍâÁ¬½Ó£º
1¡¢×óÍâÁ¬½Ó£¨°Ñjoin×ó±ß±íÀïµÄËùÓÐÊý¾Ý¶¼²é³öÀ´¡£È»ºó°Ñjoin Óұ߱íÖеķûºÏÌõ¼þµÄÊý¾Ý¼ÓÔÚ×ó±ß±íµÄºóÃæ¡£¡£¡£¡££©
SELECT * from t_empl_info as a LEFT OUTER JOIN t_dept as b
ON a.dept_no=b.dept_id
--ͨ³£Çé¿öÏÂÊÇ£º×ó±ß±íÊǶ෽±í¡£Óұ߱íÊÇÒ»·½±í
--ÈýÕűíµÄ×óÍâÁ¬½Ó
SELECT *
from A left join B
on A.a=B.a
left join C on B.b = C.b;
Ïà¹ØÎĵµ£º
1.ʹÓÃManagement Studio Express£¬ÓÓWindowsÉí·ÝÑéÖ¤”µÇ¼£¬Ñ¡ÖÐSQL·þÎñÆ÷Ãû£¬ÓÒ»÷Êó±êÑ¡ÔñÊôÐÔ£¬ÔÚ·þÎñÆ÷ÊôÐÔÑ¡ÏîÒ³Ãæ£¬Ñ¡Ôñ“°²È«ÐÔ”£¬½«·þÎñÆ÷Éí·ÝÑéÖ¤ÓÉ “WindowsÉí·ÝÑéÖ¤”¸ÄΪ“SQL ServerºÍWindowsÉí·ÝÑéÖ¤”£¬µ¥»÷È·¶¨¡£
2.ʹÓÃSQL Server 2005ÍâΧӦÓÃÅäÖÃÆ÷£¬Ñ¡ ......
ÄãµÄSQL Server 2000±ØÐë´òÉÏSP3µÄ²¹,È»ºó°²×°MicrosoftµÄJDBCÇý¶¯,½«ÒÔÏÂÈý¸öjar°ü¸´ÖƵ½WebContent\WEB-INF\lib
msbase.jar
mssqlserver.jar
msutil.jar
ÏÂÃæÊDzâÊÔ´úÂ룬ûÓб¨´íÊý¾Ý¿â¾ÍÄÜÕý³£Á¬½Ó
public class DbcTest {
/**
* @param args
*/
public static void main(String[] args) {
Str ......
ÎÒÃÇÒª×öµ½²»µ«»áдSQL,»¹Òª×öµ½Ð´³öÐÔÄÜÓÅÁ¼µÄSQL,ÒÔÏÂΪ±ÊÕßѧϰ¡¢ÕªÂ¼¡¢²¢»ã×ܲ¿·Ö×ÊÁÏÓë´ó¼Ò·ÖÏí£¡
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLE µÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom× ......
SQL:1999Á¬½Ó
SQL:1999Á¬½ÓÔÚÓï·¨ÉϺʹ«Í³µÄORACLEÁ¬½ÓÓÐןܴóµÄ²»Í¬¡£SQL:1999Á¬½ÓµÄÀàÐÍÔÚfromÓï¾äÖÐÖ¸Ã÷¡£ORACLE 9IÖ§³ÖµÄSQL:1999Á¬½Ó°üÀ¨£º
l CROSSÁ¬½Ó
l NATURALÁ¬½Ó
l ......
ÔÚSQL SERVER 2005/2008ÖÐÓµÓÐÒ»¸ö¶ÔÏó
´ÓSQL SERVER2000Éý¼¶µ½2005/2008ºó£¬Ò»¸öÎÒÃDZØÐëÖØÐÂÈÏʶµÄÇé¿öÊǶÔÏó²»ÔÙÓÐËùÓÐÕߣ¨owner£©¡£¼Ü¹¹°üº¬¶ÔÏ󣬼ܹ¹ÓÐËùÓÐÕß¡£Èç¹ûÄã²éѯ±ísys.objects£¬Ä㽫»á¿´µ½Õâ¿´ÆðÀ´ÊÇÕýÈ·µÄ£¬Ö»ÊDZíÖл¹ÓÐÒ»¸ö×Ö¶Îprincipal_id£¬µ«ÊÇÒ»°ãÇé¿öÏÂËü×ÜÊÇNULLÖµ¡£²»¾ÃǰһÌ죬ÎÒͻȻ¶Ôprincipal ......