我需要計算每個技術人員在解決月份爲 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