我有一个查询,它为我创建了我想要的东西,但是如果我开始使用参数,它说我并不是所有的变量都绑定了。如何在以下 select 语句中实现两个日期之间的查询?
任何帮助将不胜感激。
问候
选择案例 vp.player_type
当'L'然后
lpm.last_name
当'C'然后
cpm.last_name
以姓氏结尾,
案例 vp.player_type
当'L'然后
lpm.first_name
当'C'然后
cpm.first_name
以名字结尾,
滞后(ch.next_date)超过(按ch.virtual_customer_id按ch.end_date划分)作为scheduled_date,
ch.date_entered 作为 start_com_date,
ch.end_date 作为 end_com_date,
回合(ch.date_entered - 滞后(ch.next_date)
over(按 ch.virtual_customer_id 分区,按 ch.end_date 排序))作为 date_dif,
案子
当 ch.date_entered - 滞后(ch.next_date)
结束(按 ch.virtual_customer_id 分区,按 ch.end_date 排序)> 45 然后
'过期'
别的
无效的
以逾期结束,
tt.tot_actualloss 作为 lg_loss,
stt.tot_actualloss 作为 slot_loss,
ch.响应,
to_char(ch.notes) 作为注释,
Casinocrm.main.getUserName(ch.user_id) 作为entered_by,
ch.next_date 作为 next_com_date,
ch.id 作为communication_id,
ch.virtual_customer_id
来自 Casinocrm.communication_history ch
加入 Casinocrm.virtual_player vp
在 vp.id = ch.virtual_customer_id
离开加入 logismos.player_master lpm
在 lpm.link_id = vp.player_id
和 vp.player_type = 'L'
离开加入 Casinocrm.potential_player_master cpm
在 cpm.link_id = vp.player_id
和 vp.player_type = 'C'
左加入 logismos.trak_totals tt
在 tt.memb_linkid = lpm.link_id
左加入 logismos.trak_totals_sl stt
在 stt.memb_linkid = lpm.link_id
其中 ch.date_entered 在 TO_DATE(:startdate,'DD/MM/YYY' ) 和 TO_DATE(:enddate,'DD/MM/YYY' ) 之间