**字段列表中的未知列“timestamp”**

gab6jxml  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(332)

我得到这个错误,我是新的sql我没有得到任何关于我的问题的解决方案,我真的很感激如果有人能帮我摆脱这个错误

SELECT job.jobStatusId, 
       job.customerId,
       mazdoor.mazdoorName,
       mazdoor.picture , 
       job.mazdoorId, 
       job.workingHistoryId, 
       service.serviceName, 
       service.price , 
       contractor.cnic , 
       contractor.contractorId, 
       contractor.contractorName , 
       SUM(CONCAT(Extract(HOUR From timeStamp) ,'.', Extract(MINUTE From timeStamp))*service.price*0.05 ) AS GRANDTOTAL , 
       Date(job.timesStamp) AS Date 
FROM job  
INNER JOIN mazdoor ON mazdoor.mazdoorId = job.mazdoorId 
INNER JOIN service ON service.serviceId = job.serviceId 
INNER JOIN contractor ON mazdoor.contractorId = contractor.contractorId  
WHERE job.jobStatusId = '3' 
  AND mazdoor.jobsCompleted>=1  
  AND  mazdoor.contractorId = '$email' 
GROUP BY contractor.cnic
xtupzzrd

xtupzzrd1#

--这一栏拼错了

SELECT job.jobStatusId, 
       job.customerId,
       mazdoor.mazdoorName,
       mazdoor.picture , 
       job.mazdoorId, 
       job.workingHistoryId, 
       service.serviceName, 
       service.price , 
       contractor.cnic , 
       contractor.contractorId, 
       contractor.contractorName , 
       SUM(CONCAT(Extract(HOUR From timeStamp) ,'.', Extract(MINUTE From timeStamp))*service.price*0.05 ) AS GRANDTOTAL , 
       Date(job.timeStamp) AS Date --< column name was wrong. 
FROM job  
INNER JOIN mazdoor ON mazdoor.mazdoorId = job.mazdoorId 
INNER JOIN service ON service.serviceId = job.serviceId 
INNER JOIN contractor ON mazdoor.contractorId = contractor.contractorId  
WHERE job.jobStatusId = '3' 
  AND mazdoor.jobsCompleted>=1  
  AND  mazdoor.contractorId = '$email' 
GROUP BY  job.jobStatusId, 
       job.customerId,
       mazdoor.mazdoorName,
       mazdoor.picture , 
       job.mazdoorId, 
       job.workingHistoryId, 
       service.serviceName, 
       service.price , 
       contractor.cnic , 
       contractor.contractorId, 
       contractor.contractorName ,
       Date(job.timeStamp)
`
-- and the non-aggregate fields has to be group by

相关问题