0
CREATE TABLE ProfileMiningStats(server VARCHAR(20), DateStatsCollected DATE(), NoSubmittedCompanies INT, NoCompaniesFinishedSuccessfully INT, AvgTimeTakenByEachProfile TIME());

看到以下错误消息:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(), NoSubmittedCompanies INT, NoCompaniesFinishedSuccessfully INT, AvgTimeTakenB' at line 1

如有错误请更正查询

4

2 回答 2

1

这就是你所追求的吗?

create table ProfileMiningStats(
  server VARCHAR(20), 
  DateStatsCollected DATE, 
  NoSubmittedCompanies INT, 
  NoCompaniesFinishedSuccessfully INT, 
  AvgTimeTakenByEachProfile TIME);

您在 DATE 和 TIME 数据类型之后有 ()。

于 2013-11-26T06:37:16.127 回答
0

请试试这个它会工作。(您使用了 Date()、Time() 之类的函数,这就是问题所在)
创建表 ProfileMiningStats( server VARCHAR(20), DateStatsCollected DATE, NoSubmittedCompanies INT, NoCompaniesFinishedSuccessfully INT, AvgTimeTakenByEachProfile TIME );

于 2013-11-26T06:40:22.193 回答