Viewing 15 posts - 1 through 15 (of 7,545 total)
The TaskNames would have to be contiguous for that method to work. I wanted to also handle some other TaskName appearing between "Distribute" and "Print", just in case.
November 22, 2024 at 12:50 am
SELECT JobID
FROM dbo.tblPrintTask
GROUP BY JobID
HAVING MAX(CASE WHEN TaskName = 'Distribute' THEN TaskID END) <
MAX(CASE WHEN TaskName = 'Print' THEN TaskID END)
November 21, 2024 at 8:25 pm
(page bump needed?)
November 20, 2024 at 7:31 pm
You could easily have an order of magnitude more rows in SG table than in T, and if you have a phone app waiting for the response, I would still...
November 20, 2024 at 7:31 pm
Nice.
Also, you don't have to change the FKs in other tables if you need one for just ID. Instead, just add a unqiue nonclus index on ( ID ); it...
November 19, 2024 at 11:56 pm
> What difference the client is a phone? <<
Because to determine all the Tests that haven't been fully graded could require scanning a very large number of StudentGrade rows.
If, instead,...
November 19, 2024 at 8:56 pm
I would use option 2 in this case. The safest way to set the flag consistently accurately is to use a trigger on the StudentsGrade table.
November 19, 2024 at 6:31 am
SQL captures the size of backups in table msdb.dbo.backupset. Thus, you can query that table to add up total space used for backups.
November 19, 2024 at 5:13 am
You could do as below. You can't really GROUP BY ID, because that would separate the Small, Medium and Large into separate rows.
SELECT ...
November 18, 2024 at 3:36 pm
How is one to know when it's, say, 8AM or 9AM, and the last entry for a person was at 2AM, whether future entries were missed or the person is...
November 18, 2024 at 3:16 pm
IF you're on Enterprise Edition, you can do an online build of an index for SpoolStartDt. Then you can use that index to do the DELETEs. If you're not on...
November 15, 2024 at 6:12 pm
I haven't ultra-tuned this, but see if it gives you the correct results.
;WITH
cte_tally10 AS (
SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)
),
cte_tally_hrs AS (
...
November 15, 2024 at 4:48 am
Maybe?:
SELECT SYMBOL1, SYMBOL2
FROM (
SELECT SYMBOL1, ROW_NUMBER() OVER(ORDER BY SYMBOL1) AS row_num_1
FROM #STOCKS1 S1
WHERE NOT EXISTS(SELECT...
November 14, 2024 at 3:18 pm
Since it's not an index seek, partitioning should still help the query by reducing the number of pages it has to search. Once again, verify that by looking at the...
November 12, 2024 at 9:16 pm
It's just a predicate / search, it's not an index SEEK.
November 12, 2024 at 7:32 pm
Viewing 15 posts - 1 through 15 (of 7,545 total)