Multiple Count Statements in a single stament on a same table in sql -


how combine these 2 queries single query ? tried various options none of them worked.

sql>

select count (*) tab_proclog_cso ( to_char(starttime, 'yyyymmddhh24miss') between('20130709000000') , ('20130709010000') );    count(*) ----------      28328 

sql>

select count (*) tab_proclog_cso ( to_char(starttime, 'yyyymmddhh24miss') between('20130709010000') , ('20130709020000') );    count(*) ----------      14997 

select     sum(case when to_char(starttime, 'yyyymmddhh24miss') between('20130709000000') , ('20130709010000') 1 else 0 end) res1    ,sum(case when to_char(starttime, 'yyyymmddhh24miss') between('20130709000000') , ('20130709010000') 1 else 0 end) res2 tab_proclog_cso  

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -