collation

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
YoussefSiblini
Forum Contributor
Posts: 206
Joined: Thu Jul 21, 2011 1:51 pm

collation

Post by YoussefSiblini »

Hi I am trying to use union all:
All the tables have to be exactly the same, but what I am having trouble with is:
This is inside the table antiques in my sql:

Code: Select all

	
         1	id	int(11)			No	None	AUTO_INCREMENT	  Change	  Drop	 More 
	 2	track_ID	varchar(255)	latin1_swedish_ci		Yes	NULL		  Change	  Drop	 More 
	 3	UserName	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 4	firstname	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 5	lastname	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 6	producttittle	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 7	productdescription	text	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 8	swaptakeplace	varchar(30)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 9	ExchangeWithTittle	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 10	ExchangeWithDescription	text	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 11	shippingfirstname	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 12	shippinglastname	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 13	address1	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 14	address2	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 15	city	varchar(100)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 16	country	varchar(100)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 17	postalcode	varchar(100)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 18	phonenumber	varchar(100)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 19	email	varchar(150)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 20	Category	varchar(255)	latin1_swedish_ci		Yes	NULL		  Change	  Drop	 More 
	 21	IpAddress	varchar(200)	latin1_swedish_ci		No	None		  Change	  Drop	 More 
	 22	dateadded	date			No	None		  Change	  Drop	 More 
As you can see all the collations is set to latin1_swedish_ci.

But if I view it from the database like here:

Code: Select all

	Table 	 Action	Rows 	Type	Collation	Size	Overhead
	antiques	 Browse	  Structure	 Search	  Insert	 Empty	  Drop	0	InnoDB	latin1_general_ci	16.0 KiB	-
	art	 Browse	  Structure	 Search	  Insert	 Empty	  Drop	0	InnoDB	latin1_swedish_ci	16.0 KiB	-
	automotive	 Browse	  Structure	 Search	  Insert	 Empty	  Drop	0	InnoDB	latin1_swedish_ci	16.0 KiB	-
	bookscomicsmagazines	 Browse	  Structure	 Search	  Insert	 Empty	  Drop	0	InnoDB	latin1_swedish_ci	16.0 KiB	-
	clothingaccessories	 Browse	  Structure	 Search	  Insert	 Empty	  Drop	0	InnoDB	latin1_swedish_ci	16.0 KiB	-
As you can see the collation of it is staying latin1_general_ci and not latin1_swedish_ci which is making the UNION ALL not work.
YoussefSiblini
Forum Contributor
Posts: 206
Joined: Thu Jul 21, 2011 1:51 pm

Re: collation

Post by YoussefSiblini »

I sorted it out, I just needed to change the whole table collation in the same time.
Post Reply