Not displaying items which match criteria in Oracle SQL Developer but no error -


i have code below , used display fields wh_id of 'mp'

select o.wh_id, o.bill_to_code, d.create_date,    (case when d.pick_area 'gps%' 'gps' else d.pick_area     end) pick_area,     count(*) ouc t_order o inner join  t_pick_detail d  on o.order_number = d.order_number o.wh_id = 'mp' group o.wh_id, o.bill_to_code, d.create_date,      (case when d.pick_area 'gps%' 'gps' else d.pick_area     end) order o.bill_to_code 

it gave me following results:

enter image description here

then once add in 1 piece of criteria matches items in table above.

extra criteria is:

and d.create_date =  '19-feb-15' 

full code :

select o.wh_id, o.bill_to_code, d.create_date,    (case when d.pick_area 'gps%' 'gps' else d.pick_area     end) pick_area,     count(*) ouc t_order o inner join  t_pick_detail d  on o.order_number = d.order_number o.wh_id = 'mp' , d.create_date =  '19-feb-15' group o.wh_id, o.bill_to_code, d.create_date,      (case when d.pick_area 'gps%' 'gps' else d.pick_area     end) order o.bill_to_code 

now results shown below, makes seem though there no results info there can see above print screen. don't error though.

enter image description here

hope can help, thanks.

from performance point of view, not suggest use trunc not use regular index on date column.

better use range condition. use index on date column , see index range scan rather full table scan.

for example,

d.create_date >= to_date('19-feb-15', 'dd-mon-yy') , d.create_date < to_date('19-feb-15 ', 'dd-mon-yy') + 1 

or,

d.create_date  between to_date('19-feb-15', 'dd-mon-yy')  ,     to_date('19-feb-15 ', 'dd-mon-yy') + 1  

if want use trunc, have create function_based index.

have @ link https://hoopercharles.wordpress.com/2010/03/08/impact-of-the-trunc-function-on-an-indexed-date-column/


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

html - grunt SVG to webfont -

c# - SharpSsh Command Execution -