Category "sql"

SQL Stored Procedure Parameter set to Uppercase

I want to force a user's string input in a stored procedure to uppercase. I tried writing UPPER prior to the @parameterName but I got a syntax error. Is this

SQL Stored Procedure Parameter set to Uppercase

I want to force a user's string input in a stored procedure to uppercase. I tried writing UPPER prior to the @parameterName but I got a syntax error. Is this

Query to update the column of second table based on newly generated id of first table

I have two tables company_types and companies_profiles. company_types_id of company_types and company_type_id of companies_profiles has one to many relationship

Troubleshooting Errors with Two SUMs

I have a table, it's going to be used for a supplier scorecard, with eleven different fields that can be assigned a value of 1-5. Null values are allowed. I

SQL WHERE/AND error when using it multiple times

I've started learning SQL on Friday. I'm using pgAdmin4 I'm having trouble with one line on this code: SELECT first_name, last_name, nationality, date_of_birth

Mysql compare if date is at least two day away from now

I have a table, has field named date with type date. I have a row with date=2021-08-11, I want to perform an update, if table.date is more than 2 days from curr

Conversion failed when converting the varchar value 'Lagtime' to data type int

I am trying to use the code below to count the difference in days between the encounter begin date and submission date. SELECT e.EncounterId, e.Encounter

Connecting an HTML webpage to a SQL Server

I am attempting to display a table from my Azure SQL database on a webpage. I have been looking around and can't seem to figure out why this isn't working This

How do you search database record with multiple words?

So, say i have a record in database like "Something with corn". if i use sql like "SELECT * FROM table WHERE column LIKE '%Something corn%'", the record wont sh

TDengine import from csv file

Just found the speed for importing sorted csv file is faster than the speed for importing unsorted csv file in TDengine database, each csv file has 1000000 rows

Can PostgreSQL JOIN on jsonb array objects?

I am considering switching to PostgreSQL, because of the JSON support. However, I am wondering, if the following would be possible with a single query: Let's s

I am trying to copy a file, but getting error message

I am new to postgres, probably missing something silly like (the correct name of my directory). Can someone guide me? I am following book instructions, Practica

How to write SQL sub-query in SQL?

Here is sample data I am looking for total buying trade value and total selling trades value based on country. Here are two tables, country, and trades Table [c

How to simulate database crash in postgreSQL

I'm new into postgresSQL, in my course in "Advance database" we are given a problem to simulate a crash at given location in postgres, is anyone got an idea how

Subtract count from left join and inner join in SQL

I want to merge two tables and subtract the number of orders in resulting table from left join from the resulting table in inner join. This is what I have done

Running total in SQL with a reset condition

I have a data that combines inventory, sales forecast, and future supply data for different parts. I have combined it to give me a table that gives a net quanti

Snowflake error in RStudio which limits the size of rows to fetch - Error: nanodbc/nanodbc.cpp:2695: HY000

I have an issue where I kind of know what it is but do not know the solution to it. When I fetch data from an external Snowflake DB, it limits the size of the d

AEM JCR SQL2 query to find all pages contains specific component

I wish to build a sql2 jcr query to find all pages under /content that contains this component, e.g /apps/platform/aem-core/components/content/form/form I read

SQL data, selecting and searching in the same table

id1 id2 v1 v2 v3 P1 I1 A B C P1 I2 D E F P2 I1 A B D P3 I1 A D E P2 I2 B D E How can I get from the table above to following: First, I need all entries with a

Is there a faster way of using NOT LIKE for a long list of search terms instead of {AND "Column" NOT LIKE '%word1%'} etc, in an SQL Query?

So I'm trying to exclude a bunch of different entries with specific words from my query and I was wondering if there was a more efficient/faster way of doing th