Skip to content

Tag: mysql

finding sum of values found from a query

I have a query which returns two rows of data as count. I want to find sum of the column values. My sql: I have tried using Select Sum(my above query) but I am getting error. I just need some of above values. Answer Can grab both result sets in a single query:

How to convert all tables in database to one collation?

I’m getting error: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) for operation ‘=’” I tried changing both tables manually to utf8_general_ci,IMPLICIT but I’m still getting the error. Is there a way to convert all tables to utf8_general_ci,IMPLICIT …

Formatting column in SQL

I would like to insert the pipe character | in a column to separate two sections of the output. Is there a way to put one in every row of a column as long as there is data in that row? Answer

CREATE TYPE on MySQL

I couln’t create a new data type on MySQL. Query is given below How can I do that on MySQL Answer You cannot. MySQL doesn’t have user-defined types. (At least, not in current versions.)

Mysql queries giving error after upgrading

why this simple query not working. I know it was OK before I upgraded my mysql version. i know there are some syntax changes in new version that I done. but this is simple query no join, but not working. Please help me. EDIT: Upgraded from mysql4 to mysql5 and error is ‘syntax error’ Answer I thin…