Skip to content

Tag: sql

How to join two tables where Columns are not matching in SQL

I have two different tables and in the select query I need to bring the SUM of the other column but both the tables have some similar data but still in the query output values are not coming fine. I am using below query :- Query 1 Query 2 Query 1 output COUNTRY BUDGET_SALES MY 20463355.16 SG 41095952.67 Query…

PostgreSQL create index on JSONB[]

Consider a table defined as follows: How can I create an index on json key type and how can I query on it? Edit: Previously, there were no indexes on json keys and select queries used an unnest operation as shown below: The problem is, if the table has a large number of rows, the above query will not only

How to import a JSON file into postgresql databse?

I just tried to read a .JSON file in my PostgreSQL database but it is not able to read it. I did it with a .csv file, but with a .JSON file, I am not able to do it. This is how the .JSON file looks like: This is the code that I tried, I created the table first and

How to get partial string in oracle

I need to find all the users in the table that have this pattern I only know the first 10 digits, the email address can be different. I did something like this, but I get nothing back Is there another way that I can capture this data in oracle? Thank you! Answer More a comment that a real answer, but