Skip to content
Advertisement

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 and be done with it? Answer You need to execute a alter table statement for each table. The statement would follow this form:

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

Why am I getting an error in this create table script? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 9 years ago. I’m attempting to write

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 think you upgraded from

Advertisement