Category "sql"

How do I get DISTINCT columns and COUNT occurrences of sub DISTINCT columns [closed]

I am having some difficulty building a file download statistics database and displaying the information how I would like. Table: customer_stat

ORA-02070: database %s%s does not support %s in this context

I have an Oracle database from which I am selecting a table from a remote postgres database, pg. The column mydate is of type date. select to_char(mydate,'mm-d

Inserting generated UUID into table - can't adapt type UUID

I'm populating a table like so: ... time_id = uuid.uuid4() location_id = uuid.uuid4() id = row['id'] sql = ''' INSERT INTO "my-schema"."example"(

Convert NOT IN (SELECT ...) from SQL to DQL

I've got a query which works in SQL :SELECT * FROM SOCIETY WHERE id NOT IN (SELECT society_id FROM activity) I'm trying to convert this into a DQL so I tried l

SSIS Alternatives to one-by-one update from RecordSet

I'm looking for a way to speed up the following process: I have a SSIS package that loads data from Excel files on a weekly basis to SQL Server. There are 3 fi

wordpress image url wrong in database

We have a wordpress website that was migrated over a few months ago and some images are displaying the wrong link still. For example, one image on a gallery has

Partition by date in Snowflake procedure removing leading zeros from date

I am trying to partition the data from a Snowflake table and storing it as a parquet file in a S3 bucket. This partition allows me to store the data organised b

What method ga4 use for streaming data to bigquery? In SQL terms, is it just insert or update too?

Sorry, I'm new to this. I read a few sources including some google documentation guides but still don't quiet understand: Every time GA4 streams data into bigqu

How to get value printed on Postgres

I have a requirement to translate it to an SQL script. I am using the information schema to get all the columns of a table and print their distinct count. I was

How can I avoid TimeOut exception using Entity Framework with a stored procedure?

I'm using Entity Framework to call a stored procedure which takes 2 minutes to execute. As a result, I get a timeout exception. Is there any way I can use my

encountered : identifier expected cross, having,inner left, limit,order,right,where,commacausedby:exception syntax error

my query looks like but I am getting error select a.account_number,b.reference_acc from hdd.master_record format1 a join hdd.monetary b on a.load_date = b.load_

MySQL normalization issue with performance

I have a table of shops and anoher table of shop configs (plan, discounts and Others configs), I need to add some Fields to store SMTP configs. Should I create

I have a SQL Table with employees and a timestamp for their every action. How to calculate how much they worked, and how much they idled (20min gaps)?

I have a very simple query that looks like this SELECT Username ,FORMAT(Timestamp, 'MM/dd/yyyy') as Date ,FORMAT(Timestamp, 'hh:mm tt') as Time FROM

Best way to check if database already exists with flask-sqlalchemy, otherwise create

I have a database app, and want to create the tables and database on the fly when starting the app for the first time. If the app is restarted, it should only c

Go_gorm: AutoMigrate with foreignKey( Failed to open the referenced table )

I've just entered stuyding Go language and try to use gorm connecting w MySQL. When I try to create tables with foreign key, it gives me same error "Error 1824:

how to calculate YTD (Year To Date) value in Oracle table

There is a table and its data looks like this: year month v1 v2 2017 1 2 3 2017 2 4 5 ... .. .. .. 2017 12 9 3 2018 1 1 3 2018

how to fix ORA-06575: Package or function is in an invalid state error

I'm looking to create a package, already have a working procedure. Working on a function, step by step and I have encountered an ORA-06575: Package or function

How to make case in HANA

I have the following query in postgres which gives the meter range and the number of vehicles travelled between the range SELECT (CASE WHEN meter >= 0 AND m

SQL (INSERT INTO) COMMAND DOES NOT WORK IN OLEDB IN VB.NET

I want to update in the "CIU" column in the database "GSDTS" and retrieve the data or values from the database "IFGTS" in the column "PRSOBNET" based on the con

Acces to MySQL automatic data transfer

I have to pass data from Access database to a MySQL database attached to HeidiSQL automatically every minutes. To do that i put the data into excel files format