SQL Table
Table-Naming Standards
Table-naming standards, as well as any standard within a business, are critical to
maintaining control. After studying the tables and data in the previous sections, you
probably noticed that each table’s suffix is _TBL. This is a naming standard selected
for use, such as what’s been used at various client sites. The _TBL simply tells you
that the object is a table; there are many different types of objects in a relational
database. For example, you will see that the suffix _INX is used to identify indexes
on tables in later hours. Naming standards exist almost exclusively for overall
organization and assist immensely in the administration of any relational database.
Remember, the use of a suffix is not mandatory when naming database objects.
Ïà¹ØÎĵµ£º
Oracle Êý¾Ý¿â 10g ÌṩÁË´óÁ¿°ïÖú³ÌÐò£¨»ò“¹ËÎʳÌÐò”£©£¬¿É°ïÖúÄú¾ö¶¨×î¼Ñ²Ù×÷Á÷³Ì¡£ÆäÖÐÒ»¸öʾÀýÊÇ SQL Tuning Advisor£¬Ëü¿ÉÒÔÌṩÓйزéѯµ÷ÕûÒÔ¼°ÔÚÁ÷³ÌÖÐÑÓ³¤Õû¸öÓÅ»¯¹ý³ÌµÄ½¨Òé¡£
µ«Ç뿼ÂÇÒÔϵ÷Õû°¸Àý£º¼ÙÉèÒ»¸öË÷ÒýȷʵÓÐÖúÓÚij¸ö²éѯ£¬µ«¸Ã²éѯִֻÐÐÒ»´Î¡£ÕâÑù£¬¼´Ê¹¸Ã²éѯ¿ÉÒÔµÃÒæÓÚ´ËË÷Òý£¬µ«´´ ......
¡¾×ª¡¿http://space.cnblogs.com/group/topic/33473/
http://www.cnblogs.com/ghd258/archive/2005/10/24/260836.html
Èç¹ûÔÚSQL Server ÀïÐèÒª¶¨Ê±»òÕßÿ¸ôÒ»¶Îʱ¼äÖ´ÐÐij¸ö´æ´¢¹ý³Ì»ò3200×Ö·ûÒÔÄÚµÄSQLÓï¾äʱ,¿ÉÒÔÓùÜÀí->SQL Server´úÀí->×÷ÒµÀ´ÊµÏÖ¡£
¡¡¡¡1¡¢¹ÜÀí->SQL Server´ú ......
ÔÚÈ¡Ò»¸öƽ¾ùÖµµÄʱºòÍùÍùÓöµ½Ð¡ÊýµãλÊýµÄ½ØÈ¡¡£
Ç°¼¸ÌìÓöµ½¹ýÕâô¸öÎÊÌ⣬ÔÚKingDee EAS µÄ²éѯ·ÖÎöÆ÷ÀïÃæÈç¹ûÇóijһÎïÁϵÄƽ¾ùµ¥¼ÛʱÎÒÕâÑùдµÀ£º
select avg = case sum(bentry.FQuantity) when 0 then 0 else (sum(bentry.famount)/sum(bentry.FQuantity)) end,
´ËÓï¾ä¿´ËÆûʲôÎÊÌ⣬±Ï¾¹ÊÇÇóƽ¾ùÖµ£¬¿ÉÊÇÈç¹ûÒªÔ ......
֮ǰÓÐÒ»¸öSQLServerµÄ·ÖÒ³´æ´¢¹ý³Ì µ«ÊÇÐÔÄܲ»ÊÇÊ®·ÖÀíÏë
ÓÖÕÒÁËÒ»¸ö
--SQL2005·ÖÒ³´æ´¢¹ý³Ì
/**
if exists(select * from sysobjects where name='fenye')
drop proc fenye
**/
CREATE procedure fenye
@tableName nvarchar(200) ,
@pageSize int,
@curPage int ,
......