Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.
I have date 11/23/2020
I want output as 02/22/2021 because today date is 16th March 2021, if today date is 16th April 2021 then I want result as 03/22/2021 for date 11/23/2020
tried using Datetime ...
I have a table with 2 columns in databricks and trying to get all the child nodes of a parent in spark sql.
Output 1 :
Parent Child All_Node
I have a table named EventData.
This table has a column of XML type, the column name is XmlData.
XmlData contains data in the following format:
I got a lot of instances of the same Class. Now these objects can be linked and this link can have a weight. Like in an undirected graph. Now I want to store the relationship between each two objects ...
I want to filter out result by checking if current result DOES NOT EXIST in another result
So currently I have these 2 queries
dosen AS dosen
INNER JOIN role as ...
Pretty sure it's a simple fix, but I'm lost. Trying to pull data from joined tables where there's a checkbox = 1 (gditwocertflag). I only want to see the specific row that's checked. But I'm ...
I am trying to do the following: let's say I have the following SELECT query (please excuse the german column names):
SELECT a1.aktivit?ts_id, a1.herkunft_kontakt, a1.aktionsart, a1.aktionstyp, a2....
I'm following a basic tutorial in Spark, in which we're asked to import a .csv file into a database, performing a query and collecting the results of that query.
To do so, we first create a Persona ...
I've created a trigger script for a SQL Server and I want to run it from the file it's in, but I can't find any resources from Google on how that is actually done. Has anyone tried doing this before?
hi everyone I would to ask about queryLanguage, I have got question like this "You are writing a SQL query to analyze data about recent trampoline sales. The Store_sales table describes the ...
I have a code snippet like this. I am confused about the use of %()s.
If it is used to format parameters,
shouldn't we use %(threshold)d for threshold since it's a number?
# Join with the courses ...
I want to check if we already have a record exist in table , if yes then run update query else insert query should be executed in db2 databse.
I have a table with ~3 million rows. Many looks like this (sometimes up to a 100 per customerid):
I need to choose a type for ID column in Activity Log table which would look like this:
User Logged in
Any thoughts or recommendations?
We use SQL Server 2019 and realized that Id column of some tables are increased by more than 100.000 instead of one by one. According to the some report e.g. Identity increment is jumping in SQL ...