Skip to content

Tag: mysql

MySQL result select SUM from the database

I’ve the following tables and I try to select from table1, table2 and table3 and sum them in total: CREATE TABLE `tbl_cars` ( `carID` int(11) NOT NULL, `car` varchar(255) NOT NULL, `product1` …

Type introspection in mysql query

Is there a function in mysql that tells what type the evaluated expression/column/literal is in a query? I don’t mean the information schema, but something like: And I would get something llike: This is mainly for debugging purposes. Answer No, there’s no function for what you’re describing.…

MySQL multiple columns in ALL clause [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Why it is not allowed to do the following? But it is possible to do Answer Assuming that this…

Change mysql auto increment id column value

I have a mysql table with an gpid AUTO_INCREMENT NOT NULL UNIQUE column. After filling this table (which has 50M+ entries), I have realized that mysql still increments AUTO_INCREMENT columns if transaction fails because of an IntegrityError, and understandably so. The results are gaps in AUTO_INCREMENT column…

Populate table with data stored in separate tables

I have a MySQL database separate_data, which consists of 200 tables with random names (for example first_table, second_table, …) Each of these tables have the same structure and indexes. The total size is about 30GB. I would like to copy all this data to a new MySQL database called new_database, in the …