In a PostgreSQL database, assuming there is enough disc space, can I create an index in a live production database without risk of downtime? In other words, are there locks or possible crash or data loss possible or something else with the creation of an index. To be more precise, it’s an index on a JSO…
MySQL – why limit varchar
In MySQL you have to set a limit if you are to use a varchar. Does this limit only exist to make it less likely for devs to accidentally store too much data or is there any other reason (i.e. more effcient access) to set it to a low value? Answer VARCHAR columns are represented in the database with a
Java sql error when trying to update database
I am having a sql syntax issue when I am trying to update my databse through my update method which is trigured by a button here is the button code The update method code And the error Answer You missed the commas in the UPDATE statement. It should look like:
How to get around this error related to a CASE statement in my ORDER BY syntax?
I am using SQL Server 2014 and I am querying a linked server. My T-SQL query stands as follows: My issue is that I am getting the following error message when running the above T_SQL query: How can I get around this error? Answer I don’t know where the nested case expressions are coming from. But an alt…
Flatten the Data in BigQuery
I have dimensions.key_value of RECORD type i run the following query with following output. To unnest the data i have created the following view: My Output: There are two thing i need to verify is my query correct ? How i can make the query generic i.e if i don’t know all the key, there some other keys …
How to eliminate this SQL String_Split function error
Trying to use the SQL string_split function in a dynamic query but I continue to receive the following error. Invalid column name ‘Invoice Description’. Argument data type void type is invalid for argument 1 of string_split function. I can not figure out the issue. Any help is greatly appreciated.…
SQL query with multiple OR condition inside AND returns null or empty
I’m trying to get those members who are going to match my filter criteria, but I am passing multiple OR condition inside the round brackets, and every condition which is inside the round brackets is, AND with another round bracket; however, the query does not work, and it returns an empty table, but whe…
SELECT INTO vs WITH AS: Who is faster in the temp table approach?
I have a little experience with these two structures. Is there a performance improvement using one or another to use temp tables? I know that SELECT INTO creates a table that persists after the query and is removed after some time. There is some problems when using the same query after a few seconds (SQL Erro…
How to combine multiple rows (one column) into One row
I am using SQL server 2017 and I have a scenario where I want to combine multiple rows of data into one row. Please see the below screenshot and let me know if that is possible. Thank you. Apologies if anything is missing. Please let me know the query on how to achieve this Answer SQL Server has supported str…
Django query self referencing queryset
I have a model Thing that is self referencing. The relation copied_from is being used to save the Thing-Object that the current Thing-Object was copied from. Here is my Model: class Thing(models.Model)…