I’m having some trouble with time with time zone equalities in Postgres. timestamp with time zone equality works how I would expect it to, where if the times are the same after normalizing the …
How to set timeout for anonoymous block or query in plsql?
I know you can set user profiles or set a general timeout for query. But I wish to set timeout to a specific query inside a procedure and catch the exception, something like : begin update tbl …
Why does Spring’s JDBC Templates doesn’t use the tables default value
I have a table in MYSQL and I am using JDBC Templates to do an insert into that table. One of the columns has a default value, and I am not specifying it in the Map<String, Object> parameters map. I am getting an exception Column ‘colName’ cannot be null. Can anyone explain this please? Than…
mysql selecting multiple rows that match array of ids
First of all: SELECT `key`, `value` FROM settings WHERE `key` = :base_url OR `key` = :google_analytics OR `key` = :site_domain Is this correct way of selecting multiple rows? Or is there a …
How to get the sum of a specific user from two tables?
I currently have 2 tables: Favorite: userID drinkName History: userID drinkName I want to get the sum of the total times a specific userID shows up in each table, and then then the total number of …
Searching for a specific text value in a column in SQLite3
Suppose I have a table named ‘Customer’ with many columns and I want to display all customers who’s name ends with ‘Thomas'(Lastname = ‘Thomas’). The following query shows an empty result(no rows). Also it didn’t show any error. While executing the following query giv…
Self-Referencing Data Object in CoreData
I’m making the mental switch from a lifetime of SQL to CoreData and it’s not without a few hiccups. The thing that’s kicking me at the moment is creating a self-referencing object. Allow me to explain….
Transform and group row data into columns
I’m looking for a way to combine different rows into a single row with columns. Let’s take this example table: Desired output: Please note that Data centers are not necessarily these three, they can be N different data centers that I will not know in advance. Answer With a known set of sourceDataC…
ERROR 1062 (23000): Duplicate entry ‘2147483647’ for key ‘PRIMARY’
I have a table: As we can see, the previous value, just went wrong into table. Should be 16 numbers and not only 10, actually different numbers. When i try to insert a new value: I get this error: ERROR 1062 (23000): Duplicate entry ‘2147483647’ for key ‘PRIMARY’ If bank_card is AUTO_I…
Case Sensitive column names in Sql Azure Database
Forever I’ve used a case sensitive collation in Sql Server (SQL_Latin1_General_CP1_CS_AS). I’m trying to move to Sql Azure Database and I’ve run into an unexpected problem. It looks like it’s …