在我的陈述中出现错误 [英] Erorr in my statement

查看:59
本文介绍了在我的陈述中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI
当我运行此命令时

 选择 sum(Maden) as مدين,sum(Da​​yn)دائن来自 Ezn_Qaid
其中 Qaid_date 之间 ' '  ' '
其中 Bayan_Oll = '  VISA' 



得到这个erorr

Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword ''where''.



PLZ帮帮我

解决方案

一个选择查询中不能有两个where子句(除非您有一个子查询;但这意味着您仍然有多个选择查询)

 选择 sum(Maden) as مدين,sum(Da​​yn)دائن来自 Ezn_Qaid
其中 Qaid_date 之间 ' '  ' '  and  Bayan_Oll = '  VISA'  



无论如何,介于''和''之间的日期会产生错误.如果您不需要它,为什么不简单:

 选择 sum(Maden) as مدين,sum(Da​​yn)دائن来自 Ezn_Qaid
其中 Bayan_Oll = '  VISA' 




hth,
foxyland


重复where 删除WHERE仅添加AND

在将日期与''''进行比较时可能会遇到问题,尝试在其中添加一些值

您可以尝试

 其中(Qai​​d_date 之间  ' '  ' ') and  Bayan_Oll = '  VISA' 


HI
When i run this command

select sum(Maden) as مدين,sum(Dayn) as دائن from Ezn_Qaid
where Qaid_date between ''and''
where Bayan_Oll='VISA'



get this erorr

Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword ''where''.



PLZ Help Me

Thanks

解决方案

You cannot have two where clause in one select query (unless you have a sub-query; but that means you have more than one select query anyway)

select sum(Maden) as مدين,sum(Dayn) as دائن from Ezn_Qaid
where Qaid_date between ''and'' and Bayan_Oll='VISA'



Anyway, date between '''' and '''' would generate error. If you don''t need it, why not simply:

select sum(Maden) as مدين,sum(Dayn) as دائن from Ezn_Qaid
where Bayan_Oll='VISA'




hth,
foxyland


Duplicate where remove WHERE add AND only

You could face problem while comparing date with '''' try to be specific put some values there


You can try

where (Qaid_date between ''and'') and Bayan_Oll='VISA'


这篇关于在我的陈述中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆