Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

I'm trying to put together a query where I want to access rows in a previous partition. I'm pretty sure window functions should be used here if I want to do this in one pass, but I'm open to any ...
simplycoding's user avatar
  • 3,051
0 votes
2 answers
135 views

I have a sample data of total column such as [$122,$133,$144,$233.44,$12.45] etc Total column is in varchar, I am going with CTE approach on calculating the total First - I remove the Dollar $ sign ...
Farid Avesko's user avatar
6 votes
1 answer
142 views

I have table of structure data in SQL Server. I want to travese the tree and find all nodes with a recursive query. Additionally, the structure data is versioned. I want to always use the latest ...
Truncated's user avatar
-2 votes
0 answers
43 views

I found this blog post that explains how to return the ID of a newly-inserted row in generic SQL: https://www.geeksforgeeks.org/sql/how-to-get-the-identity-of-an-inserted-row-in-sql/ Example from the ...
raphael75's user avatar
  • 3,274
-3 votes
1 answer
87 views

I have a data table cust_rma_track that I use for a Spotfire report, and built 2 visualizations for it. The visualizations are both pulling from cust_rma_track, filtering based off of trans_type. Top ...
KassieB's user avatar
  • 137
1 vote
1 answer
96 views

I am trying to use pivot, but it's not working the way I expect. The temptable I want to use input is #GenericTeam: Versionnumber Valid_from Team_name Attributenumber Attribute_displayname ...
Cees's user avatar
  • 21
-4 votes
3 answers
150 views

I was doing the first PortSwigger SQL injection lab, where the goal is to display all “Gifts” products regardless of whether they are released or not. The official solution is to inject the following ...
Diego Huite's user avatar
1 vote
0 answers
51 views

I am migrating a dag and its queries to a new DB using DBT. The problem is that one of the existing tables has an EVENT_ID column, defined as autoincrement, but when the queries try to insert data, ...
JUAN CAMILO VARGAS's user avatar
0 votes
2 answers
135 views

I need to show numbers with a single quote thousand separator in a SQL query, for example: 1'000.00 I tried with something like FORMAT(ISNULL(value, 0), N'N2') or FORMAT(ISNULL(value, 0), '###,###,##...
d_88_l's user avatar
  • 67
4 votes
1 answer
120 views

I want to be able to combine rows at PersonID level if JobTitleID are the same consecutively, where the timestamp column gets extended if the same. For example this is the raw data: I want the output ...
tommyhmt's user avatar
  • 364
-1 votes
0 answers
74 views

We have a database of a DVD club containing several entities some of them in Greek notation. One of them are clients (ΠΕΛΑΤΗΣ): CREATE TABLE [ΠΕΛΑΤΗΣ] ( "ID" integer NOT NULL, ...
Konstadinos Kokozidis's user avatar
3 votes
2 answers
232 views

I have table with an encrypted column UserName: I also have a stored procedure (in SQL Server) defined as below : SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[...
lm.'s user avatar
  • 4,361
Best practices
1 vote
11 replies
106 views

Employee table: Id Name 1 John 2 Peter Attendance table: Id EmployeeId DateTime 1 1 2026-01-10 09:00:00 2 1 2026-01-10 14:00:00 3 1 2026-01-10 15:00:00 This is my SQL query: SELECT E.Name, A....
Gulfam Ali's user avatar
0 votes
2 answers
194 views

I have a TimeZones table that provides a list of all the time zones in the world with names, offset info, etc. I also have a CountryId column in my table which tells me which country time zones are in ...
Sam's user avatar
  • 31k
0 votes
0 answers
56 views

I ran the DiskANN sample script: <https://github.com/Azure-Samples/azure-sql-db-vector-search/blob/main/DiskANN/diskann-quickstart-azure-sql.sql> -- Step 3: Create a vector index on the ...
Harish's user avatar
  • 301

15 30 50 per page
1
2 3 4 5
44965