I have to update the database with the CSV files. Consider the database table looks like this: The CSV file data looks like this: As you can see the CSV file data some data modified and some new records are added and what I supposed to do is to update only the data which is modified or some new records
Tag: sql
SQL multiple left join as new columns performance
I have 3 tables : account id name 1 Google 2 Apple custom_field id name 1 Phone 2 Email custom_field_submission id custom_field_id entity_id value 1 1 1 555-444-333 2 1 2 111-111-111 3 2 1 google@goog.com 4 2 2 apple@apple.com Expected result after query id name Phone Email 1 Google 555-444-333 google@goog.co…
choose from a time period oracle sql
I have timestamp date format in column FIRST_DATE and i need to choose time period from a certain hour, for ex. all from 18:00 10.05.21 to 18:00 11.05.2021 the problem is that date column in timestamp format – FIRST_DATE: 10/05/2020 0:00:03,000000 TIMESTAMP(6) so i tried to use it: so with this way i wa…
I am getting this error on inserting data in ClickHouse
Unknown error field: Code: 27. DB::ParsingException: Cannot parse input: expected ‘”‘ before: ’40”,”gmtoffset”:0,”open”:109.6,”high”:109.6,”low”:109.6,”close”:109.6,”volume”:0,”previousClose”:108.…
Redshift table access history
I wonder are there any way to get table access history in Redshift cluster? Our cluster has a lot of tables and it is costing us a lot. I would like to discover what specific tables have not been accessed for a given period and then I would drop those tables. Are there any ways to get table access history?
How to autofill a column with sequential number, but based on a parameter?
I’m trying to add a new column to few MySQL (MariaDB) tables. I want to make the column auto-filled with sequential number. What I figured out so far is: It works perfectly. However, I don’t know how to make it so that the order in which the numbers are assigned is based on another value, namely a…
Recursive query to get totals by distinct item from a row of a data
I have SQL data that looks like the following: How can I recurse through this data to get total wins, draws, losses by team for both home and away? My output would look something like: I was able to get this done in a very linear way by simply get a list of distinct teams and for each team looping
How do I update “case when” kogi mosi [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question I already have a table with some sample data. When I execute this I get: Error converting …
How to select data with percentages from Clickhouse?
Given the following table: I’m trying to fetch all statuses by host, with their relative percentage. In order to do that, I need to count results grouped by host and status, and divide each counted field by its total host fields count. For example, this query would have worked in MySQL: But ClickHouse t…
Query to delete record when no matching in delta table
please help to write a better delete query. DB2 does not have “not matched by source” with merge. Need to delete rows which does not have matching codes from source file for an ID and need to delete rows only for the ID’s present in source file. sample data row with value ID=1 & code=IJK…