Category "sql"

Error while creating View in SQL Database

I am working on database where I am trying to create view to get all records from Art table but i am getting error. My SQL query for creating the view is as fol

I have 29638 row to enter in my table. I used one of the solutions from a previous question but got an error message that the identifier is to long

I have 29638 row to insert into sql. Im used a solution from a previous question INSERT [HCO2].[Visits].[Biglist]... I got a error Msg 103, Level 15, State 4, L

Window function based on transition of a column value

I have response query like below dest emp 893106 0 717205 1 888305 0 312301 1 645100 0 222001 0 761104 1 And I want to get window function to separate rows li

can dolphinscheduler run a sql script or a python script file?

Can I upload sql scripts or python scripts, and run them in a process? I can only write sql statements in SQL tool, but I have some .sql files that should be ex

HOW TO GET QUERY IN SQL USING PHP IN SQL TIGGERING

This is my code my $sql variable didn't give query plese help me for this I try this but I couldn't please help me with that <?php $connect = mysqli_con

spark sql Find the number of extensions for a record

I have a dataset as below col1 extension_col1 2345 2246 2246 2134 2134 2091 2091 Null 1234 1111 1111 Null I need to find the number of extensions available fo

Alter table add column if not exists in MySql

I need to make an alter table via migration on a node:14 server with umzug. The code is : IF NOT EXISTS( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_

How to load data of string of date in csv to mysql database?

Here is a glimpse of my .csv file: Name,Start Date,End Date,Budget Class 1,1/1/2020,31/1/2020,"USD10,000.00" Class 2,1/2/2020,28/2/2020,"USD14,000.00" The date

Want SQL statement to return all columns

Write a SELECT statement that returns the LastName, FirstName, and AnnualSalary columns of each instructor that has a unique annual salary. In other words, don

How do i create a specific one many view using Microsoft SQL Server

I have a master table and a detail table. Question 1: I would like my view to look like this master1 row, nulls master1 row, detail1 row for master1 master1 row

How should I optimize the order by index

1.select * from transactions where from_account_id = 51118 order by block_number, index desc limit 20; Limit (cost=295.39..4973.89 rows=20 width=605) ->

Get working days (Monday-Friday) and replace them with "between" in query

I have some query in which I am substituting 2 dates in a field "between". SELECT ... FROM ... WHERE o.EventDate between @startDate and @endDate How to make it

How to prevent python from automatically escaping backslash with dubble backslash

I'm looking for a method to forward a string so for example ip 1.1.1.1 becomes ^1\.1\.1\.1$. I tried a couple of thing but all of them results in the following

Unable to make raw SQL calls from Entity Framework Core

I am working on a project where I am moving specific rows from a table between multiple different environments. The table has an Identity column and when I try

proc Sql Case Statement returning Null values

Can someone look at my Proc Sql and tell me why the below case staement is returing Null values in the data? I have never seen this, there are no errors, the co

How to do Group By and SELF JOIN in single table

Here is what I am trying to get done. Partly I am thru, Partly I am stuck, and need some help. Table structure: CREATE TABLE UserRole ( Id bigint NOT NULL A

Append Changed and New Employees to Existing Table

I have a table (Table 1) which is a list of employees and data points about them. The data that populated Table 1 is regularly changed and added to in its sourc

SQL Indexing not improving speed

Given an SQL database with index for (startpage, endpage), with a relation Articles(*ID*, title, startpage, endpage), why isn't a query SELECT title FROM Artic

Error: can not delete or update parent row

I'm trying to Delete all the records related to this supplier from all relevant tables for Supplier with supplierNum = S3. But when I try to delete, I get an er

Is there a way to build custom expression in SqlKata for the Select/Order clause

I wanted to pass custom expression to SqlKata The expected output is: SELECT DISTINCT(Column1 + ' ' + Column2) FROM Table1 ORDER BY Column1 + ' ' + Column2