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

ÓÃsql²é¿´±í½á¹¹


1.oracle
 sql   = "SELECT column_name, data_type, data_length, nullable";
 sql += " from user_tab_columns ";
 sql += " where table_name='";
 sql += $tableName;
 sql += "'";
 select * from user_tab_comments   ²éѯ±íÃû¼°±í˵Ã÷£¨comment)
 select * from user_col_comments    ²éѯ±í¼°±íÖÐ×ֶεÄ˵Ã÷
2.sql server
select  name,xtype,length,isnullable  from  syscolumns
where id =(select  top 1 Id   from  sysobjects  where name = '±íÃû');
 
 sql   = "select  name,xtype,length,isnullable  from  syscolumns where id =";
 sql += " (select  top 1 Id   from  sysobjects  where name = '";
 sql += $tableName;
 sql += "')";
3.my sql
 sql   = "show columns from ";
 sql += $tableName;
»ò
 sql   = "desc ";
 sql += $tableName;
»ò
 sql   = "describe ";
 sql += $tableName;
 
 


Ïà¹ØÎĵµ£º

PL/SQL developer½«excelÊý¾Ýµ¼ÈëOracle

×¼±¸¹¤×÷£ºÊý¾ÝÇåÏ´¡£¼ì²éÊý¾ÝÀàÐͺͱíÖеÄ×Ö¶ÎÀàÐÍÊÇ·ñÆ¥Å䣻¼ì²é¿ÕÖµÔ¼Êø£»È¥Î޹ؿոñµÈ¡£ÕâЩ¼ì²é¹¤×÷¿ÉÒÔͨ¹ýExcelµÄÊý¾Ýɸѡ¹¦ÄÜ£¬¿´Ò»ÏÂÿ¸ö×Ö¶ÎËùÓеÄÖµ£¬ÔÙÑ¡Öв»ºÏ¹æ·¶µÄ½øÐÐÐ޸ġ£   
    ²½Ö裺
1£©µÇ¼pl/sql developer£¬µÇ¼ʱѡÔñ´ýµ¼Èë±íËùÔÚÊý¾Ý¿â£¬ÔÚ²éѯ´°¿ÚÀïÊäÈësele ......

¼¸µÀ¾­µäµÄSQL±ÊÊÔÌâÄ¿

¼¸µÀ¾­µäµÄSQL±ÊÊÔÌâÄ¿£¨Óд𰸣©
£¨1£©±íÃû£º¹ºÎïÐÅÏ¢
¹ºÎïÈË      ÉÌÆ·Ãû³Æ     ÊýÁ¿
A            ¼×          2
B            ÒÒ     &n ......

35Ìõ»ù±¾SQLÓï¾ä

 1¡¢²éÕÒÔ±¹¤µÄ±àºÅ¡¢ÐÕÃû¡¢²¿ÃźͳöÉúÈÕÆÚ£¬Èç¹û³öÉúÈÕÆÚΪ¿ÕÖµ£¬ÏÔʾÈÕÆÚ²»Ïê,²¢°´²¿ÃÅÅÅÐòÊä³ö,ÈÕÆÚ¸ñʽΪyyyy-mm-dd¡£
select
emp_no,emp_name,dept,isnull(convert(char(10),birthday,120),'ÈÕÆÚ²»Ïê') birthday
from employee
order by dept
 
¡¡¡¡
2¡¢²éÕÒÓëÓ÷×ÔÇ¿ÔÚͬһ¸öµ¥Î»µÄÔ±¹¤ÐÕÃû¡¢ÐÔ±ð¡ ......

mysqlµÄsql_mode½éÉÜ

mysql¿ÉÒÔÔËÐÐÔÚ²»Í¬sql modeģʽÏÂÃ棬sql modeģʽ¶¨ÒåÁËmysqlÓ¦¸ÃÖ§³ÖµÄsqlÓï·¨£¬Êý¾ÝУÑéµÈ£¡
 
²é¿´Ä¬ÈϵÄsql modeģʽ£º
select @@sql_mode;
ÎÒµÄÊý¾Ý¿âÊÇ£º
STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
ÔÚ´ËģʽÏÂÃ棬Èç¹û²åÈëµÄÊý¾ÝµÄ³¤¶È´óÓÚ¶¨ÒåµÄ³¤¶È£¬ÄÇô¾Í»á±¨´í£¡
  ......

sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð


 
sqlÖ®left join¡¢right join¡¢inner joinµÄÇø±ð
×òÌìÃæÊÔ8Ò³±ÊÊÔÌâÄ¿,»ù±¾É϶¼ÊÇSQl µÄ,ÌرðÊÇÕ⼸¸öÇø±ð,¼ÇµÃ²»ÊǺÜÇåÎú,Ö»¼ÇµÃleftÊÇÒÔ×ó±íΪÖ÷±í,
rightÒÔÓÒ±íΪÖ÷±í,µ¼ÖÂ×ö´íÁ˼¸¸ö!½ñÌìËÑÁËÏÂ!×ÜËãŪÇå³þÁË!ÒÔÏÂÊÇתÌû!
left join(×óÁª½Ó) ·µ»Ø°üÀ¨×ó±íÖеÄËùÓмǼºÍÓÒ±íÖÐÁª½á×Ö¶ÎÏàµÈµÄ¼Ç¼
right j ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ