这是我的查询,它没有显示任何数据请有人帮助我:( [英] This is my query and it is not showing any data please someone help me :(

查看:83
本文介绍了这是我的查询,它没有显示任何数据请有人帮助我:(的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Assign_taskk中选择task_desp,其中due_date> ='6/26/216'



sup_id =

(从Approved_project中选择sup_id,其中completion_status ='进行中'

AND

P_id =(从student_proj_detail选择P_id WHERE stnId ='1')) >


我尝试了什么:



i已在sql server中执行但未运行

Select task_desp from Assign_taskk where due_date >= '6/26/216'
and
sup_id =
(Select sup_id from Approved_project where completion_status = 'In Progress'
AND
P_id = (Select P_id from student_proj_detail WHERE stnId = '1'))

What I have tried:

i have executed in sql server but not working

推荐答案

简单:没有匹配的行。



从SSMS开始并尝试查询的每个部分。从以下开始:

Simple: there are no matching rows.

Start with SSMS and try each part of the query. Start with just:
Select task_desp from Assign_taskk where due_date >= '6/26/216'

并确切地查看它返回的行。

然后,使用这些行来检查第二部分。然后是最后一个。

我猜这是日期:SQL并不特别喜欢欧洲日期,并且更喜欢ISO:yyyy-MM-dd所以你的日期可能只是转换厉害。您也可能将数据库中的日期存储为NVARCHAR或VARCHAR以及导致问题的日期。

我们不知道 - 我们无法访问您的数据,因此我们无法检查。所以你必须自己做这个!

(但是如果你需要两个嵌套的SELECT来处理WHERE子句,我怀疑你的数据库组织得有点糟糕 - 我认为这个设计是相反,支持JOIN将更容易使用。)

And see exactly what rows it returns.
Then, use those rows to check the second part as well. And then the final one.
I'm guessing that it's the date: SQL doesn't particularly like European dates, and prefers ISO: yyyy-MM-dd so it's possible that your date is just converting badly. It's also possible that you are storing dates in your DB as NVARCHAR or VARCHAR and that that is causing the problem.
We don't know - we don't have any access to your data, so we can't check. So you will have to do this one yourself!
(But I'd suspect that your database is a bit badly organised if you need two nested SELECTs just to handle the WHERE clause - I think a design that supported JOIN instead would be a lot easier to work with.)


这篇关于这是我的查询,它没有显示任何数据请有人帮助我:(的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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