Viewing 15 posts - 196 through 210 (of 2,610 total)
Are you creating a temp table i.e. one that begins with a hash (#) or are you using a permanent table name?
December 28, 2023 at 9:26 am
Yes, that's a bit shorter and generally more efficient. I'm wondering if there were a lot more that 12 items per customer and the right indexes on the...
December 27, 2023 at 4:37 pm
;WITH CTE AS
(
SELECT DISTINCT CustomerCode
FROM myTable
)
SELECT B.*
FROM CTE A
CROSS APPLY(SELECT TOP(12) *
...
December 21, 2023 at 9:07 pm
;WITH CTE AS
(
SELECT DISTINCT CustomerCode
FROM myTable
)
SELECT B.*
FROM CTE A
CROSS APPLY(SELECT TOP(12) *
...
December 21, 2023 at 5:53 pm
If you are sure you always want it to seek the values you can give the query a hint:
SELECT *
INTO #SROISDPL
...
December 19, 2023 at 5:54 pm
You need a colon after numbers:
def calculate_sum(numbers):
total = 0
for num in numbers:
...
December 19, 2023 at 10:39 am
As Jeff said partitioning is the best way and fastest way to remove large chucks of data by date.
When you want to regularly remove old data from a database, there...
December 14, 2023 at 11:40 am
Paste it into Excel and create a line chart then add a trend line.
December 13, 2023 at 3:07 pm
Here is something to get you started:
WITH CompanyData AS
(
SELECT * FROM (VALUES
('[24]7 Customer, Inc.'),
...
December 12, 2023 at 9:05 pm
The code was not created by me. I am just investing some one else's code, this person is leaving us soon. I just want to make sure that the...
December 12, 2023 at 6:46 pm
Have you checked it returns the same results?
December 12, 2023 at 6:27 pm
You are thinking LEFT JOIN works like OUTER APPLY (it doesn't). You can rewrite the first query using OUTER APPLY instead of LEFT JOIN:
SELECT Grades.[Name] AS Grade,
...
December 12, 2023 at 4:46 pm
I asked ChatGPT:
WITH RankedEmployees AS (
SELECT
employee_id,
employee_name,
department,
joining_date,
...
December 12, 2023 at 10:30 am
This appears to be a classic "Next_ID" table and I find it difficult to understand why anyone would be using such a thing in this day and age, especially...
December 11, 2023 at 4:51 pm
I would indent the query like this:
FROM CHG
LEFT JOIN CAMCHARG CC
LEFT JOIN CAMRULE CR
...
December 9, 2023 at 2:43 am
Viewing 15 posts - 196 through 210 (of 2,610 total)