瀚高数据库的时间比较

warning: 这篇文章距离上次修改已过332天,其中的内容可能已经有所变动。
 SELECT
            COUNT (1)
        FROM
            (
                select
                    (

                        CASE
                            WHEN b.type = 0 then '自住户' WHEN b.type = 1 then '租户' WHEN b.type = 4 then '常客' else '其他'
                            end
                        ) "type"
                from
                    zhsq_housing_information b
                        left join zhsq_user_info a on
                        b.user_id = a.id
                where to_char (to_Date(b.create_time,'yyyy-MM-dd  HH24:mi:ss'),'yyyy-MM-dd')  between to_char (to_Date(#{startTime},'yyyy-MM-dd  HH24:mi:ss'),'yyyy-MM-dd')
        and  to_char (to_Date(#{endTime},'yyyy-MM-dd  HH24:mi:ss'),'yyyy-MM-dd')
            )

to_char (to_Date(b.create_time,'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd') between to_char (to_Date(#{startTime},'yyyy-MM-dd HH24:mi:ss'),'yyyy-MM-dd')

    and  to_char (to_Date(#{endTime},'yyyy-MM-dd  HH24:mi:ss'),'yyyy-MM-dd')
        )
版权声明 ▶ 本网站名称:我的学习笔记
▶ 本文链接:https://ooolo.net/article/228.html
▶ 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行核实删除。
▶ 转载本站文章需要遵守:商业转载请联系站长,非商业转载请注明出处!!!

none
最后修改于:2023年05月24日 19:40

添加新评论

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png