mybatis 關於 if test 判斷字符串的大坑


https://blog.csdn.net/chenaini119/article/details/51917263

還有XML文件 不能用> <來表達大於小於 。。 例如 grade>0 , grade<10

https://blog.csdn.net/zheng0518/article/details/10449549

老周一直遇到的bug


今天遇到的一個數據查詢 的難題

就是統計 評價當前電影 各星星等級 的人數

問題:搜mysql 同一字段 相同的值 的條數

找到解決辦法的博客:https://blog.csdn.net/eaphyy/article/details/71305422

我最后寫出的語句是這樣的:

select m.id,m.name,COALESCE(startb.one,0) as onestar,COALESCE(startb.two,0) as twostar,COALESCE(startb.three,0) as threestar,COALESCE(startb.four,0) as fourstar,COALESCE(startb.five,0) as fivestar from movie m  LEFT JOIN  (SELECT id,star,movie_id,sum(case star when 1 then 1 else 0 end) as one, sum(case star when 2 then 1 else 0 end) as two,sum(case star when 3 then 1 else 0 end) as three ,sum(case star when 4 then 1 else 0 end) as four ,
sum(case star when 5 then 1 else 0 end) as five  from score where movie_id =5) as startb on  startb.movie_id = m.id

springboot 的靜態文件 問題


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM