Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : sql

sql serverת»»ÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

¸÷λ´óÏÀ£ºÎÒÏÖÔÚÓÐÒ»¸öÊý¾Ý¿â£¬ËüÀïÃæÓÐÒ»ÕÅ±í¡£ÕâÕűíÀï´æ·ÅÁËÉÌÆ̵ÄÃæ»ýµÈÐÅÏ¢¡£ÎÒÏÖÔÚÏë²éѯ³öÉÌÆÌÃæ»ýÔÚ30-50Ö®¼äµÄ£¬µ«ÊDZíÀïµÄÊý¾ÝÈ«²¿ÎªcharÀàÐ͵ģ¬ÎÒ¸ÃÔõô½øÐÐת»»±È½Ï¡£
SQL code:
where cast(col as dec(18,2)) between 30 and 50

SQL code:
cast(ÉÌÆ·Ãæ»ý as int) between 30 and 50

SQL code:
......

SQLͬһÌõ¼þ¶à×ֶβéѯ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÓÐÒ»¸ö±í£¬ÈçÏ£º
create table #tmp(id int,cusno varchar(10),cusname nvarchar(50))
insert into #tmp(id,cusno,cusname)
select 1, 'C10001', 'ÁªÏëµçÄÔ' union all
select 2, 'C10002', '»ÝÆÕµçÄÔ' union all
select 3, 'C10003', '¹È¸è¹«Ë¾'
drop table #tmp
ÈçºÎʵÏÖ£¬¿É¸ù¾Ýcusno²éѯµÃµ½cusname½á¹û£¬»òÕ߸ ......

Ò»SQLÓï¾ä¡£ - MS-SQL Server / Ó¦ÓÃʵÀý

½²Êý¾Ý´Ótk_inalert00 ²å½ø tk_in00
SQL code:

select * from tk_in00
where exists (select shop_id,alt_id from tk_inalert00 where tk_in00.shop_id=tk_inalert00.shop_id and tk_in00.in_id=tk_inalert00.alt_id)
ÉÏÃæÒѾ­²éѯ³öÁËtk_inalert00Óëtk_in00 ÖÐÒѾ­²åÈëµÄÊý¾Ý
Ôõô²éѯ³ö δ²åÈëµÄÊý¾Ý¼Ç¼
se ......

SQL²éѯÏÔʾÎÊÌâ - MS-SQL Server / »ù´¡Àà

ÓÐÒ»¸ö×Ö¶ÎYear ÀïÃæ´æµÄÊÇÊý×Ö±ÈÈç 1,2,3 ......
ÈçºÎÔÚ²éѯÓïÑÔÀïʵÏÖ¸ñʽת»» ²éѯºóµÄ½á¹ûÊÇ £º1Äê £¬2Äê £¬3Äê ¡£¡£¡£
SQL code:
replace([year],',','Äê,')


SQL code:
replace([year],',','Äê,')
³­Ï®Ò»±é2Â¥µÄ
{{ ......

sqlʱ¼ä¸üÐÂÎÊÌâ¡£ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÎÒÔÚ²éѯ·ÖÎöÆ÷ÀÊäÈë
select DATEADD(s,1196660520,'1970-01-01 00:00:00') 
Äܹ»²éѯ³öÕýÈ·µÄ½á¹û µ«ÊǾßÌåÉè¼Æµ½×Ö¶Îʱ ¾Í±¨´í£º
select DATEADD(s,regtime,'1970-01-01 00:00:00') from fs_me_users
·þÎñÆ÷: ÏûÏ¢ 8116£¬¼¶±ð 16£¬×´Ì¬ 1£¬ÐÐ 1
º¯Êý dateadd µÄ²ÎÊý 2 µÄÊý¾ÝÀàÐÍ nvarchar ÎÞЧ¡£
1196660 ......

¹ØÓÚsql×÷ÒµÈÕÖ¾¼Ç¼ÎÊÌâ - MS-SQL Server / ÒÉÄÑÎÊÌâ

ÎÒµÄ×÷ÒµÊÇÿ·ÖÖÓÖ´ÐÐÒ»´Î
ʱ¼ä³¤ÁË»áºÜ´óÂð£¿Ó°ÏìsqlµÄÔËÐÐÂð£¿
ÓÐʲôÓÅ»¯°ì·¨Âð£¿
-- ÄÇÒª¿´ÄãÊÇʲôÑùµÄ×÷ÒµÂÔÚÓÅ»¯µÄͬʱÄÜ·ñÂú×ãÄãµÄ¾ßÌåÐèÇóÂ

-- ¾¡ÎÊһЩ¹ÖÎÊÌ⣬ҲÀµµÃ°ÑÎÊÌâ˵¾ßÌåÒ»µã£¬µ±È˼ÒÊÇÄã¶Ç×ÓÀïµÄ»×³æ£¿

ÎÒµÄ×÷ÒµÊÇÿ·ÖÖÓÖ´ÐÐÒ»´Î
ʱ¼ä³¤ÁË»áºÜ´óÂð£¿Ó°ÏìsqlµÄÔËÐÐÂð£¿
ÓÐʲôÓÅ»¯°ì·¨ ......
×ܼǼÊý:3315; ×ÜÒ³Êý:553; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] 2 [3] [4] [5] [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ