SQL_²éѯµ±Ìì¡¢½ü¼¸Ìì¡¢±¾ÖÜ¡¢±¾ÔµÄSQLÓï¾ä
¾³£»áÓÐʱºòÒªÓõ½²éѯµ±Ì죬½ü¼¸Ì죬±¾ÖÜ£¬±¾ÔµÄÏà¹ØÊý¾Ý£¬ËùÒԼǼһÏÂÕâЩ±È½ÏÌØÊâµÄSQLÓï¾ä~~
--µ±Ìì
(usrRegTime >=CONVERT(varchar(10),getDate(),120)+' 00:00:00' and usrRegTime <=CONVERT(varchar (10),getDate(),120)+' 23:59:59')
--½üÈýÌì
DateDiff(day,usrRegTime,getdate()) <=3
--±¾ÖÜ
Datepart(year,usrRegTime)=DatePart(year,Getdate()) and DatePart(week,usrRegTime)=DatePart (week,GetDate())
--±¾ÔÂ
Datepart(year,usrRegTime)=DatePart(year,Getdate()) and DatePart(month,usrRegTime)=DatePart (month,GetDate())
Ïà¹ØÎĵµ£º
select * from books
where 1=1
and categoryid=29
and title like('%ASP.NET%')
and unitprice>10
order by id
Select top 20 * from books order by id
--m:ÿҳÏÔʾÐÐÊý n£ºµ±Ç°Ò³Êý
select Top m * from books
where id not in
(Select top m(n-1) id from books order by id)
order by id
select * fro ......
mysql´´½¨Êý¾Ý¿âsqlʵÀý
# MySQL-Front 3.2 (Build 2.10)
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET CHARACTER SET 'latin1' ......
SQL ServerÊý¾Ý²Ö¿âÏà¹Ø¸ÅÄî-ά¶È±íºÍÊÂʵ±í¸ÅÊö ÊÕ²Ø
¿ªÊ¼Ñо¿BI£¬³õѧ¡£»á¼Ç¼һЩ¸ÅÄîÐÔµÄÎÄÕ¡£
»ù±¾¸ÅÄ
1.¶àάÊý¾Ý¼¯£º¶àάÊý¾Ý¼¯ÊÇÁª»ú·ÖÎö´¦Àí (OLAP) ÖеÄÖ÷Òª¶ÔÏó£¬ÊÇÒ»Ïî¿É¶ÔÊý¾Ý²Ö¿âÖеÄÊý¾Ý½øÐпìËÙ·ÃÎʵļ¼Êõ¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸öÊý¾Ý¼¯ºÏ£¬Í¨³£´ÓÊý¾Ý²Ö¿âµÄ×Ó¼¯¹¹Ô죬²¢×éÖ¯ºÍ»ã×ܳÉÒ»¸öÓÉÒ»×éά¶ÈºÍ¶ÈÁ ......