I have a column that is of type nullable timestamp without time zone. It is stored in my Postgres database in this format: 2021-06-24 11:00:00. And I would like to convert it to a nullable timestamp …
Cannot INSERT strings with Set Clause with mariadb connector (python)
I want to insert a new row in my table by using the python-mariadb connector. For that I prefer to use the SET clause. For some reason it does work if I only want to save ints (i.e y=2), but when I use a string, the following error occurs Unknown column ‘myString’ in ‘field list’ It se…
SQL – Select from Multiple databases
I have 10 databases all in the same instance and schema with identical tables. Looking to create a SELECT query which can use a variable of the database names and return all of the records into a single dataset. I’ve been looking around and put the following together as a test (the real select statement…
Postgresql : Query were each join result is a line
I got a database structure with three tables. On table containing some ids and two table containing the same row and a foreign key on the first table : How to get a result looking like this (a kind of left join were each result is displayed in lines instead of in additional columns in the result): Answer I th…
SQL Insert into with join and where
I have three tables. For example: newTable: oldTable: associativeTable: What I want to do now is: I want to move the name column from oldTable to newTable. I have already altered newTable and added an empty name column. Now I’m trying to write a correct INSERT INTO statement. What I have so far is: I…
Checking for different columns OR empty result PostgreSQL
I’m writing some query tests for dbt and I’d like to check that two queries return the same thing and that neither is empty. Since it’s a dbt test, I need to return a row if either of these conditions is false. So far I’ve come up with the following: Theoretically, this should return a…
Split values from many columns accordingly over multiple rows
Firstly i obatin data from Excel and convert them into DataTable in C# project. Secondly i parse this DataTable into JSON string and send it to database as a stored procedure parameter. I want to perform the merge operation on some table with values from this JSON string parameter. Values from this parameter …
Why i am getting error while executing pl/sql program?
Answer In your code you are missing the semicolon in insert statement & radius value assignment statement – Demo.
Use column references in Oracle SQL select query to avoid re-calculation
I want to create a summarised database backup report, which includes data from multiple database tables which has no relation to each other. For example, I want to include the name of the database from v$database view: And the size of the database: And consider there is no common column between those two view…
Remove specific value in a string with SQL or grafana
Displaying some data using free version of grafana. The string that has to be displayed looks like this: 5555.7777, but I only want to display 5555. Are there any functions to remove .7777 in SQL or grafana, so that the value that will be displayed only looks like this: 5555. Thanks in advance. Answer You sho…