Category "sql"

How to change normal distribution from MySQL to SQL Server

I have a code not total like normal distribution. How can I change it from Mysql to SQL Server? select latency where pow(e(), - pow((ln(latency) - 8.223) ,2)/2

How to display only results matching a certain condition in SQL?

I would appreciate your help very much as I’m still at beginner level in SQL. Thank you :) I have tables representing counties, vendors and their respecti

How to fix Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access?

When I execute the code below I get Error Code: 29. File '/Applications/XAMPP/xamppfiles/htdocs/Gefle442/csv/places.csv' not found (Errcode: 13 "Permission deni

get time for timezone

I'm hurting my head again this : On postgresql, I would like to get the local time for a given timezone. So, at 15:45 GMT, I want 16:45 for +01:00, but I can't

SSIS ERROR: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020

I have problems with SSIS process(acctually the same problem occurs for two different processes). So, we are doing some ETL work using SSIS. We have Business In

Get Records By Most Recent Date From two tables

I have two SQL tables. Each has an ID with other columns and a Date. Is there a way that I can get the result from these two tables in one query sorted by the

The parameter data type of UInt32 is invalid. (MS SQL Server)

In general we are supposed to pass integer values to our stored procedures and to do so we usually do it with this method command.Parameters.AddWithValue("@para

How to get count of tables present in a particular schema in snowflake?

I am trying to find the count of tables present in CDC schema, I tried with information_schema but the information_schema is empty for me.

PostgreSQL left join query object array aggregate

I have 2 tables: table "person" with columns: person_id, person_name table "pet" with columns: pet_id, owner_id, pet_name person data: 1, 'John' 2, 'Jill' 3,

Bulk insert, update if on conflict (bulk upsert) on Postgres

I am writing a data-mining program, which bulk inserts user data. The current SQL is just a plain bulk insert: insert into USERS( id, username, profile_pi

Problem passing user defined variables (JMeter Script)

I don't know how to pass User Defined Variables (from JMeter .jmx Script) on jenkins-taurus.yml (Taurus BlazeMeter configuration file). It keeps pushing the fix

Create a generic procedure, which inserts data into any table

I'm currently working on a .NET application and want to make it as modular as possible. I've already created a basic SELECT procedure, which returns data by che

Convert sql to tuple relational calculus

I'm trying to convert an sql query into tuple relational calculus, but there is a NOT EXIST that causes me to be stuck. SQL query: SELECT num FROM a a1, b b1

Rolling COUNT DISTINCT of n-day active users using T-SQL

I am counting 7-day active users using T-SQL. I used the following code: SELECT *, COUNT(DISTINCT [UserID]) OVER ( PARTITION BY [HospitalID],

Postgres query cost is higher but runs faster

Update on 2022-05-15 After running vacuum analyze, the query plans are below. For A query Nested Loop Left Join (cost=45913.11..496597.16 rows=10 width=128) (a

Convert Number type to Date in postgres SQL

I have a numeric data in a column 20170930, need help in converting it into Date in PostgreSQL , tried multiple ways but non seems to work

How can I check whether a number is contained in comma separated list stored in a varchar column?

I have a table with a varchar column categoryIds. It contains some IDs separated by commas, for example: id categoryIds -------------------- 1 3,

ORA-22806 (not an object or REF) on Join to a view

Here is a fairly simple query that is throwing this error: SELECT RR.REQUEST_ID FROM CCS_REQUEST_RESPONSE RR INNER JOIN VW_STUDENT_CURRENT_AND_HIST VW ON RR.S

Designing tags system with nosql/elastic search

I have to design a system with this schema. { "documentId" : 123 "documentType" : "paper" "tags" :["abc","xyz"] //other meta data of document } The queries

What is the special character VT? I need to replace it from MS SQL

Somebody left this special character in the SQL table It more looks like ♂ sign but thinner or a vertical tab Char VT sign, but when I copy it to word d