Line 1: select
2: count(1) as total_listing
3: from lis_listing a
4: left outer join neg_agent d on d.id_ren = a.id_ren
5: left outer join sys_param ap2 on ap2.itm_id = a.addr_id_area
6: left outer join lis_listing_file b on b.id_listing = a.id_listing and b.file_name = 'FilePhoto01'
7: where a.inf_data_status > 100
8: and d.inf_data_status > 100
9: /* and a.ownership = 'AGENT' */
10: /* and a.comarket = 'Y' */
11: and a.publish = 'Y'
12: and ifnull(a.id_project, '') = ''
13: and a.status = 'AVAILABLE'
14: and b.file_name = 'FilePhoto01'
15: and a.id_objective <> 2008 /* exclude New Project */
16: and ifnull(a.id_objective_sub, '') <> '2008' /* exclude Laskea v1 New Project */
17: and ifnull(a.publish_expired_dt, '') <> ''
18: /* and a.publish_expired_dt >= ? */ |