Skip to content

Tag: sql

SQL – count function not working correctly

I’m trying to count the blood type for each blood bank I’m using oracle DB the blood bank table is created like this when I use the count function the result would be like this so why the count function is not working correctly? I’m trying to display each blood bank blood type count which is…

SQL Update statement: OperationalError near “FROM”

Replacing box = with tb.box = shifts the error to the ‘.’: Error: Answer Actual implementation may not be fully adhered even with latest SQLite to support UPDATE-FROM. Specifically, docs do not indicate: JOIN in outer query is supported in UPDATE. FROM table should not repeat table in UPDATE. Tabl…

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 …