A very simple delete (by key) on a small table (700 rows) every now and then stays “idle in transaction” for minutes (takes milliseconds usually) even though all the locks are marked as “granted”. What can I do to pinpoint what causes it? I’m using this select: which shows a lot …
SQL ZOO List each continent and the name of the country that comes first alphabetically
Im confused why it could not be Can anyone please explain to me why it has to be x.continent=y.continent and not x.name=y.name ? Table Answer when you use x.name=y.name you are comparing country name from x with the country name from y if both instances have the same country name. That basically would just re…
To UNION or Not to UNION
I am currently running into an issue with my UNION clause. I am trying to figure out how many orders I am import via each day. The problem is, I have two tables that these orders are stored in OLDORDERHEADER and ORDERHEADER. After an order is completed, it moves from the ORDERHEADER table into the OLD. Both h…
MySQL said 1064 You have an error in your SQL syntax
I wrote a MYSQL Procedure for my user registration page, I have already written the PHP part to send data from there to MySQL, and it works fine (tried with a dummy data and retrieval). But there is …
Select values based on DISTINCT combination of rest of columns Oracle DB
I want to select row IDs associated with distinct column combinations in the remainder of a table. For instance, if the distinct rows are I want to get the row IDs associated with each row. I can’t …
InvalidOperationException: No columns were selected when performing a DELETE query
I have the feeling I’m missing something obvious, but I can’t quite put my finger on it. So when this piece of code gets executed, I get the exception: Even though I don’t need anything back from my call. I just want to know whether or not my DELETE query has succeeded. The strange part is t…
Inserting data into MySQL from a dropdown
I’m trying to make a dropdown list that allows users to select a training program that matches their needs, so when they select it, the option will go into a table in the MySQL database. This is my HTML form: What I need is an SQL query that will go with it, so when they select ‘Example option 3&#…
Oracle: Count non-null fields for each column in a table
I need a query to count the total number of non-null values for each column in a table. Since my table has hundreds of columns I’m looking for a solution that only requires me to input the table name. Perhaps using the result of: to get the column names and then a subquery to put counts against each col…
Combine Geocode with marker clustering
How to use MarkerCluster with geolocations from a database, displaying markers on the map works fine. but I haven’t been able to implement marker clustering. Any help would be appreciated Answer You are creating a new MarkerCluster every time you create a marker. Create it once, add all the markers to t…
MySQL SHOW TEMPORARY TABLES;
I’m learning SQL with MySQL 5.7. And I wanna enumerate all tables include temporary tables! But when I query SHOW TABLES; It shows only non-temporary tables. How can I list all tables?