SELECT * FROM 當(dāng)前表
憑借整站使用H5開發(fā)的創(chuàng)新體驗(yàn)、定制設(shè)計(jì)、設(shè)計(jì)團(tuán)隊(duì)積累與透明式的服務(wù)過程,符合行業(yè)特點(diǎn),專屬顧問根據(jù)企業(yè)產(chǎn)品,消費(fèi)群體屬性,準(zhǔn)確定位;設(shè)計(jì)師以目標(biāo)客戶為中心,以突出品牌官網(wǎng)特性為宗旨,定制專屬網(wǎng)站建設(shè)設(shè)計(jì)方案。
WHERE id = ( SELECT MAX( id ) FROM 當(dāng)前表 WHERE userid= '10000' )
解亂鎮(zhèn)賀釋一下:首先括號(hào)里先查出此userid登錄的所有記錄,然后去max最大的id,最后嘩派把最大的id的記錄查出來,旅稿即檢索出上次此用戶登錄的信息
select a.name name1,a.*,b.value,b.* from piwik_site a,piwik_archive_numeric_2013_10 b where b.period in(1,2,3) and b.name='nb_visits' and a.idsite=b.idsite order by b.value desc
如果頁雀升歲面顯示的是這個(gè)語句,那么最后一笑顫個(gè)應(yīng)該是select a.name name1,a.*,b.value,b.* from piwik_site
a,piwik_archive_numeric_2013_10 b where b.period in(1,2,3) and
b.name='nb_visits' and a.idsite=b.idsite order by b.value asc limit 1
或者先執(zhí)行頃睜一次select count(*) 拿到數(shù)量num,再select a.name name1,a.*,b.value,b.* from piwik_site
a,piwik_archive_numeric_2013_10 b where b.period in(1,2,3) and
b.name='nb_visits' and a.idsite=b.idsite order by b.value desc limit num-1,1
查穗汪譽(yù)詢今天最后一條數(shù)據(jù)
SELECT * FROM `weibo_logs` where DATEDIFF( NOW(),date)=0 order by `date` desc limit 1
查詢符合條件的猜段weibo_user_id每天的一條數(shù)據(jù)
SELECT weibo_user_id, DATE_FORMAT(date,'%Y-%m-%d') FROM `text` where 'weibo_user_id'='{$source_account-id}' GROUP BY DATE_FORMAT(date,'%Y-%m-%d')
這樣會(huì)有排序問題,那么就先排序
SELECT DATE_FORMAT(date,'%Y-%m-%d') as d
FROM (SELECT * FROM `text` ORDER BY date DESC) as s
where 'weibo_user_id'='陵納{$source_account-id}'
GROUP BY DATE_FORMAT(date,'%Y-%m-%d')