1樓:匿名使用者
你這問題好模糊,,,
連表欄位都沒有給出,,,
給你大概寫下,,,
select 訪問人
from 表
where convert(varchar(7),日期欄位,120)='2014-04'
有問題再追問吧
2樓:
select convert(varchar(7),date,23) as date,count(*) from testip group by convert(varchar(7),date,23) 貌似只要加一個 count函式就好了這個是統計數量
你要是 看2014-4都有哪些人的話 就select convert(varchar(7),date,23) as date,(訪問人) from testip
where convert(varchar(7),date,23) ='201404' group by convert(varchar(7),date,23)
大概就是這個樣子了
3樓:匿名使用者
select name, count(*) as num
from testip group by name
where convert(varchar(7), date, 23)='2014-04'
sql查詢問題
mysql select from a id b num 1 b1 200 2 b1 300 3 b1 400 4 b2 120 5 b2 920 5 rows in set 0.00 sec mysql select b,sum num from a group by b b sum num b1...
sql中的查詢問題
select name from user where userid in select id from information where score 60 當選出的id無重複時用這個,如 1,2,3 select name from user where userid in select dis...
SQL關聯查詢問題
select id,date,number,price 所要查詢的資料 from t1 where number in select number number查詢條件,按number分組 from t1 group by number and date in select max date 查詢按...