lundi 29 décembre 2014

Remove duplicate terms from column


This the tags column where all terms should be listed only once. Would like to remove all additional words from this column. For example the below contant:



Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, Features, , Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, Cuisines, , Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, Services, , Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, Meal For Two, , Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, Last Order/Booking (P.M), , Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, , East#West, Malad East, Dafftary Road, Mumbai, Maharashtra, BookUrTableId,



Should show as below:



Lakshmi Bar & Restaurant, Dining & Leisure, Restaurants, Restaurants- Multi Cuisine, Hotel, East, West, Malad East, Dafftary Road, Mumbai, Maharashtra, Features, Cuisines, Services, Meal For Two, Last Order/Booking (P.M), BookUrTableId



Where i tried to run the query and insert this into a table it gave an error as the content in this column was going too long and stops the execution of the query.


Also it would be preferred if i can get this done in mysql rather than using php or any other programming language.


Please help.





Aucun commentaire:

Enregistrer un commentaire