Skip to content

Renaming index gives error Explicit @objtype id not recognised

I am trying to rename an index and getting an error: Error: Explicit @objtype ‘idx_FinData20’ is unrecognized. I can see both the table and index exist. Then what is the problem Answer First – your syntax is wrong. You need only two arguments, first should be table_name.old_name and second o…

How to split datetime 1 row into 2 or more rows based duration-mysql

How to split 1 row of datetime record into multiple rows by splitting duration based on datetime for every hour Input: Want to cut every hour by exact time by dividing duration Output: Answer You should try this query Here i have assumed that login and logout time have same date. it will give difference in mi…

Invalid JSON Text – SQL (Java JSON Object)

I’m putting in JSON into an SQL table (type: json) and it claims something is wrong – but I can’t tell what it’s pointing out directly. Current json I’m trying to input: Yes, it is “json within json” but the code I’m writing is kind of dependent on it being that…

R connecting to Local SQL Server

I cannot connect to my local sql server through Rstudio. I am able to connect to a SQL Server that my company hosts and I can connect to my local SQL Server through Management Studio. What am I doing …

Finding a single element in postgres json array

I have a table that has a Json typed column and I am trying query that table based of values that are contained in that json column. Here is the relevant DDL: Here is what a roles value would look like: I want to be able to perform a query like this: So I’ve tried this: And it is giving

SQL wildcards in PYMYSQL search

I am struggling to put together a simple SQL wildcard search for my Flask application. I am using an HTML form field to run a simple mysql query “WHERE CustomerName LIKE ‘a%’”- https://www.w3schools.com/sql/sql_wildcards.asp – However I am unable to get the right positioning for the se…