Ò»¸ö¶à±íǶÌײéѯµÄsqlÓï¾ä
select batch_no "Åú´ÎºÅ",get_id "·ÖÀà" from (
select(
select plan1.batch_no from product_plan plan1 where plan1.item_no=(select head1.product_code from wo_head head1 where head1.order_no =bbb)) batch_no,
(select decode(get_id,'BUY','Í⹺¼þ','MAK','×ÔÖÆ¼þ','MB','䶨') from item where item_no= aaa) get_id
from (select req.item_no aaa,req.order_no bbb from process_req req where req.status_id='C'and req.order_no in(select head.order_no from wo_head head where head.batch_no in (select batch_no from product_plan) or head.product_code in ( select item_no from product_plan )))) order by qty desc
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃæ£¬ºóÃæ ......
ÔÚSQL Server 2005Êý¾Ý¿âÖÐʵÏÖ×Ô¶¯±¸·ÝµÄ¾ßÌå²½Öè:
1¡¢´ò¿ªSQL Server Management Studio
2¡¢Æô¶¯SQL Server´úÀí
3¡¢µã»÷×÷Òµ->н¨×÷Òµ
4¡¢"³£¹æ"ÖÐÊäÈë×÷ÒµµÄÃû³Æ
5¡¢Ð½¨²½Ö裬ÀàÐÍÑ¡T-SQL£¬ÔÚÏÂÃæµÄÃüÁîÖÐÊäÈëÏÂÃæÓï¾ä£¨ºìÉ«²¿·ÖÒª¸ù¾Ý×Ô¼ºµÄʵ¼ÊÇé¿ö¸ü¸Ä£¬'D:\LMS2.0\LMS2.0\bak\' ¸ÄΪ×Ô¼ºµÄ±¸·Ý·¾¶£¬ ......
EXECºÍsp_executesqlµÄÇø±ð£¿
DBCC FREEPROCCACHE --¡·Çå¿Õ»º´æÖеÄÖ´Ðмƻ®
SELECT cacheobjtype,objtype,usecounts,sql from sys.syscacheobjects WHERE sql NOT LIKE '%cach%' AND sql NOT LIKE '%sys.%' --¡·²éÕÒ¶ÔÓ¦µÄ»º´æÖеĶÔÓ¦¼Æ»®
SQL ServerΪÿһ¸öµÄ²éѯ×Ö·û´®´´½¨ÐµÄÖ´Ðмƻ®£¬¼´Ê¹²éѯģʽÏàͬҲÊÇÕâÑù
......
ΪÁË´ó¼Ò¸üÈÝÒ×Àí½âÎÒ¾Ù³öµÄSQLÓï¾ä£¬±¾Îļٶ¨ÒѾ½¨Á¢ÁËÒ»¸öѧÉú³É¼¨¹ÜÀíÊý¾Ý¿â£¬È«ÎľùÒÔѧÉú³É¼¨µÄ¹ÜÀíΪÀýÀ´ÃèÊö¡£
¡¡¡¡1.ÔÚ²éѯ½á¹ûÖÐÏÔʾÁÐÃû£º
¡¡¡¡a.ÓÃas¹Ø¼ü×Ö£ºselect name as 'ÐÕÃû' from students order by age
¡¡¡¡b.Ö±½Ó±íʾ£ºselect name 'ÐÕÃû' from students order by age
¡¡¡¡2.¾«È·²éÕÒ:
¡¡¡¡a.Ó ......