为什么这个查询给我一个错误 [英] why this query gives me an error

查看:99
本文介绍了为什么这个查询给我一个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们



我需要根据今天的日期订购EPF号码。哪里错了



我的桌子名字BreakFast



ID int

EPF_Number varchar(50)

COUNT int

DATE date

TIME time(7)







  SELECT  DATE = CONVERT( DATE ,GETDATE()) FROM  BreakFast 其中 EPF_Number 





错误

在预期条件的上下文中指定的非布尔类型的表达式,靠近' EPF_Number'。''

解决方案

用英语大声说出来......

'请从表中选择我的日期BreakFast其中EPF_Number'...

哪里有EPF_Number,什么?

Where子句不完整,因为其中没有实际条件...

在任何其他方面太哟你查询错了 - 检查 CONVERT功能 [ ^ ]以查看它获得的参数...

您还提到了订单的需要,但在您的查询中没有任何ORDER BY子句...



(如果我试图有任何意义根据你的要求,你应该有这样的查询:

从早期订单中选择EPF_NUMBER(按日期订购)


where子句中缺少值

Dear friends

I need to order EPF Numbers according to the today date. where is the wrong

My Table Name BreakFast

ID int
EPF_Number varchar(50)
COUNT int
DATE date
TIME time(7)



SELECT DATE=CONVERT(DATE, GETDATE())  FROM BreakFast where EPF_Number 



error
An expression of non-boolean type specified in a context where a condition is expected, near 'EPF_Number'.''

解决方案

Say it aloud for yourself in English...
'Please select me the date from the table BreakFast where EPF_Number'...
Where EPF_Number, what?
Where clause is incomplete as there is no actual condition in it...
In any other aspect too you query is wrong - check CONVERT function[^] of SQL to see what parameters it gets...
You also mentioned a need for order, but no ORDER BY clause in your query of any kind...

(If I try to make any sense of your request, you should have some query like this:
SELECT EPF_NUMBER FROM BREAKFAST ORDER BY DATE)


Missing values in where clause


这篇关于为什么这个查询给我一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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