我需要计算每个技术人员在解决月份为 2012年1月的门票时花费的总天数,并按升序列出它们。简单的SQLPLUS问题..我的回答是错误的
我试图改写这一问题使其在第一所以这里
更清晰的找到所有在2012年1月的月票高科技PPLS并显示花费在每个总天数。
继承人我尝试
select pplSoft, days_worked_on as pplWorkedOn
from Tickets, Tech_personnel
where date_submitted >= '01-JAN-2012' AND date_submitted <= '31-JAN-2012'
group by pplSoft having pplWorkedOn =
(select days_worked_on WHERE date_submitted >= '01-JAN-2012'
AND date_submitted <= '31-JAN-2012');
哪项是错误的...帮助表示赞赏!
TECH PERSONNEL (pplSoft, fname, lname, pittID, expertise, office phone) where fname is first name, and lname is last name.
USERS (pplSoft, fname, lname, pittID, office phone)
CATEGORIES (category id, category, description) where this table lists all possible categories of submitted tickets.
INVENTORY(machine name, IP, network port, MACADDR, location id)
LOCATIONS(location id, location, building, notes)
TICKETS (ticket number, owner pplSoft, date submitted, date closed, days worked on, category id, machine name, location, description)
ASSIGNMENT (ticket number, tech pplSoft, date assigned, status) where status held is an enumeration, could be: assigned, in progress, delegated, closed successful, or closed unsuccessful.
您在where子句中依赖隐式日期转换。你应该使用to_date函数。 – 2012-02-14 23:38:00
@MikeMcAllister - 实际上我只是'打断'OP的代码。我通常只会改变与手头问题相关的内容。但我同意不使用日期函数可能会产生问题。 – APC 2012-02-15 09:59:29
我考虑对OP的问题发表评论,但认为这会引起误解,因为主要问题在其他地方。 – 2012-02-15 16:23:30