不确定如何进行此查询。不知道该怎么称呼这种类型的查询,请更正此标题!
该查询应该使用 SQL 与 ms access 2003 一起运行。不明确支持 JOIN 函数。隐含在 WHERE 子句中是可以的...只要不使用 JOIN INNER JOIN 等单词,任何地方的隐含都可以。
DayNumnber PastTime
.
.
.
333 Homework
333 TV
334 Date
620 Chores
620 Date
620 Homework
725 Chores
725 Date
888 Internet
888 TV
.
.
.
嘿,我想要一个查询,可以显示每天完成的最重要的过去时间(电视和互联网不算!)。所以重要性是家庭作业>家务事> Date.So:
DayNumber PastTime
333 Homework
334 Date
620 Homework
725 Chores
可能会改变这个问题的东西。尽管所有不同的过去时光都在一张桌子上一起聆听。但那是因为我附加了表格。最初是作业条目。杂务条目和日期条目。互联网条目。电视条目。来自不同的桌子。
eg homework 333
homework 620
如果不先附加这些表格,是否会更容易做到这一点?我希望它能用附加的表格来完成,但是
我正在考虑插入的混合。删除...但最困难的部分是检查是否有一些适合日期的事情以及如何在当天完成更重要的事情。谢谢
This query is supposed to run with ms access 2003 using SQL. the function JOIN is NOT supported explicitly. implicitly in the WHERE clause is fine...implicity anywhere is fine as long as the word JOIN INNER JOIN Etc is not used.
DayNumnber PastTime
.
.
.
333 Homework
333 TV
334 Date
620 Chores
620 Date
620 Homework
725 Chores
725 Date
888 Internet
888 TV
.
.
.
Hey I would like a query that can Show the most important past time done for each day (TV and internet do not count!) .So importance would be Homework > Chores > Date.So:
DayNumber PastTime
333 Homework
334 Date
620 Homework
725 Chores
Something that might change this problem. Altho all the different past times are listen in a table together. but that was because i appended the table. originally the homework entries. chore entries and date entriess . internet entriess. tv entries. came from different tables.
eg homework 333
homework 620
Is it easier to do it without appending these tables first? I would hopefully like it to be done with the appended table but ya
I was thinking of a mixture of insert. delete... but the hardest part is checking that there is something there for a date a few things and how to put the more important thing done that day . Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建另一个表:
这是项目的优先级列表。
下一步:
这将为您提供每天最重要的过去时间。由于电视和互联网未列出,因此它们不会出现。
但它会给你一个号码,而不是名字。
如果您有更好的 SQL,则可以将其连接回 Priority_table 并查找名称。但我想你必须手动完成该部分。
如果您愿意更改名称并称呼他们:
相反,您可以这样做(无需任何额外的表格):
因为它按字母顺序对名称进行排序,所以它总是会给您最好的名称。
您可以添加
WHERE
来删除电视和互联网。Create another table with:
This is a priority list for the items.
Next do:
This will give you the most important past time for each day. And because TV and Internet are not listed they will not show up.
But it will give you a number, and not the name.
If you had a better SQL you could then join this back to the Priority_table and lookup the name. But I guess you will have to do that part manually.
If you are willing to change the name and call them:
instead then you could do (without any extra table):
Since it sorts the name alphabetically it will always give you the best one.
You can add a
WHERE
to remove TV and Internet.