Why I obtain this syntax error (ERROR 1064 (42000)) performing this DDL query that creates a new table in my DB?

222
March 18, 2017, at 04:07 AM

I am using **MySql and I have a problem creating a table on it.

Why when I perfrom this DDL query to create a new table I am obtaining an error message (but the table is create on my DB):

CREATE TABLE tkws (
  id           BigInt UNSIGNED NOT NULL AUTO_INCREMENT,
  target_id    BigInt UNSIGNED NOT NULL,
  target_value VarChar(256) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  value        VarChar(16) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, 
  PRIMARY KEY (
      id
  )
) ENGINE=MyISAM AUTO_INCREMENT=1 ROW_FORMAT=COMPACT DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE tkws COMMENT = '';
ALTER TABLE tkws ADD CONSTRAINT fk_tkws_targets FOREIGN KEY (target_id)
  REFERENCES targets (id)
  ON DELETE NO ACTION 
  ON UPDATE NO ACTION;
CREATE INDEX fk_tkws_pgrfas 
 ON tkws();

Performing this query I obtain this error message:

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 ')' at line 2

Why? What is wrong? What am I missing?

Rent Charter Buses Company
READ ALSO
I want select last inserted value of specific column among multiple columns of table in mysql using php

I want select last inserted value of specific column among multiple columns of table in mysql using php

I want select last inserted value of specific column among multiple columns of table in mysql using php

227
generate 100 10-digit random numbers and save to database

generate 100 10-digit random numbers and save to database

This is a pretty simple function yet it keeps giving me errorsIm writing a script to generate 100 10-digit random numbers but I keep having this error: "check the manual that corresponds to your MySQL server version for the right syntax to use near 'rand(1111111111,...

325
extract a pattern number from url mysql or python

extract a pattern number from url mysql or python

I have a bunch url that has a string either has

390
About the ORDER BY - MySQL

About the ORDER BY - MySQL

I'm trying to get all last user's chats with other users:

299