我正在尝试在SQL中使用此语句创建一个表,但它表示缺少右括号。
这是声明
CREATE TABLE Bk_Jobs (
Job_ID Int (20) Job_Title Varchar (255),
Min_Salary Decimal (25),
Max_Salary Decimal (25),
);
答案 0 :(得分:1)
CREATE TABLE Bk_Jobs (
Job_ID INT PRIMARY KEY
, Job_Title VARCHAR(255)
, Min_Salary DECIMAL(25)
, Max_Salary DECIMAL(25)
);
答案 1 :(得分:1)
将int(20)更改为int < 设置逗号:
Job_ID Int , Job_Title Varchar (255)
CREATE TABLE Bk_Jobs (
Job_ID Int,
Job_Title Varchar (255),
Min_Salary Decimal (25),
Max_Salary Decimal (25)
);
答案 2 :(得分:0)
您在最后一栏中有一个额外不必要的逗号,将其删除。你也错过了Job_ID
定义后的逗号。 INT
没有大小,因此将int(20)
更改为int
CREATE TABLE Bk_Jobs (
Job_ID Int, --missed this one
Job_Title Varchar (255),
Min_Salary Decimal (25),
Max_Salary Decimal (25),
);
| here, this one is unnecessary.
答案 3 :(得分:0)
你也可以尝试添加昏迷betwin Job_ID Int(20)和Job_Title Varchar(255)
答案 4 :(得分:0)
这句话必须更好:
CREATE TABLE Bk_Jobs (
Job_ID Int (20),
Job_Title Varchar (255),
Min_Salary Decimal (25),
Max_Salary Decimal (25)
);
答案 5 :(得分:0)
有时编程错误可能有点滑稽。他们有时像我们一样无能为力:p
你在开头就错过了一个逗号,最后还有一个额外的逗号。
<?php
// Array which will hold all analyzed lines
$uniqueEntries = array();
$dublicatedEntries = array();
$delimiter = ',';
$file = 'test.csv';
//Open the file
if (($handle = fopen($file, "r")) !== false) {
// read each line into an array
while (($data = fgetcsv($handle, 8192, $delimiter)) !== false) {
// build a "line" from the parsed data
$line = join($delimiter, $data);
//If the line content has ben discovered before - save to duplicated and skip the rest..
if (isset($uniqueEntries[$line])){
dublicatedEntries[] = $line;
continue;
}
// save the line
$uniqueEntries[$line] = true;
}
fclose($handle);
}
// build the new content-data
$contents = '';
foreach ($uniqueEntries as $line => $bool) $contents .= $line . "\r\n";
// save it to a new file
file_put_contents("test_unique.csv", $contents);
?>