mysql cannot add rows with "UNION"
mysql cannot add rows with "UNION"
(OP)
Hello everyone,
Here is code to create table named 'abcd'/
When I run this code a new abcd table is created containing one row.
When I try to create that table with 2 lines I run the following:
But here I recieve the following error message:
Thanks
Here is code to create table named 'abcd'/
CODE --> mysql
USE skullcrashingwords; DROP TABLE IF EXISTS abcd; CREATE TABLE abcd( ID INT AUTO_INCREMENT, Name VARCHAR(255) not null collate utf8_unicode_ci, KEY (ID) ); INSERT INTO abcd(name) SELECT 'aaaaa';
When I try to create that table with 2 lines I run the following:
CODE --> mysql
USE skullcrashingwords; DROP TABLE IF EXISTS abcd; CREATE TABLE abcd( ID INT AUTO_INCREMENT, Name VARCHAR(255) not null collate utf8_unicode_ci, KEY (ID) ); INSERT INTO abcd(name) SELECT 'aaaaa'; UNION SELECT 'bbbb';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT 'bbbb'' at line 1Can anyone help me with that enigmatic error ?
Thanks
RE: mysql cannot add rows with "UNION"
CODE
RE: mysql cannot add rows with "UNION"
unnecessary semicooln was illcopied, sorry for that.
Even though your code yielded error message it works !
I use "UNION" alone on tables that have INDEXES attached and it works ! Table with "KEY" column and with no accompanied INDEX "UNION" alone doesn't work but your suggestion made it work !
Thanks, but I still wonder why...
RE: mysql cannot add rows with "UNION"
Chriss
RE: mysql cannot add rows with "UNION"
RE: mysql cannot add rows with "UNION"
https://dev.mysql.com/doc/refman/8.0/en/charset-li...
So if you write
CODE
Chriss