2
insert into ageData (PatientID, Age)
select PatientID from AEDepartment,
select DATEDIFF(hour,DOB,GETDATE())/8766 from AEDepartment;
錯誤消息:下面的代碼有什麼問題?
Incorrect syntax near the keyword select
insert into ageData (PatientID, Age)
select PatientID from AEDepartment,
select DATEDIFF(hour,DOB,GETDATE())/8766 from AEDepartment;
錯誤消息:下面的代碼有什麼問題?
Incorrect syntax near the keyword select
您應該只有一個SELECT
聲明。
INSERT INTO ageData (PatientID, Age)
SELECT PatientID, DATEDIFF(hour,DOB,GETDATE())/8766
FROM AEDepartment
感謝您的澄清! :) – user1781830
@ user1781830不客氣':D' –
如果您覺得答案能解決問題,請點擊白色複選標記(*大約15分鐘到1小時後*),將其標記爲「接受」。這有助於將重點放在仍然沒有答案的舊版SO問題上。 [*接受答案如何工作?](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) –