Viewing 15 posts - 2,056 through 2,070 (of 4,087 total)
Actually ACCT IN (111, 222, 555, etc.) is shorthand for ACCT = 111 OR ACCT = 222 OR ACCT = 555, etc., so they are equivalent in terms of performance.
Drew
December 28, 2016 at 12:41 pm
There's not much that you can do to fix bad data, especially if there is no apparent pattern to the bad data. You should go to the people who...
December 28, 2016 at 10:40 am
You're overcomplicating things. There is no reason to use windowed functions here. You want a simple aggregate.
-- original code with windowed functions
select catalog_name, CatalogCount, Last_update_time from
(
...
December 28, 2016 at 9:49 am
ChrisM@Work (12/28/2016)
drew.allen (12/19/2016)
SELECT *
FROM (
SELECT
*,
rn = ROW_NUMBER() OVER(PARTITION BY ProductId, ObjectId ORDER BY CheckNumber DESC)
FROM EuroLuxProductBE.dbo.pdt_multidimensions m
CROSS APPLY...
December 28, 2016 at 8:23 am
Simon Hammill (12/27/2016)
Thanks for the replies, after a bit of playing about I finally got it to work as I needed. I used the below code.
SELECT a.accomname, a.availno -...
December 27, 2016 at 3:27 pm
wweraw25 (12/27/2016)
DECLARE @TableName As varchar(500), @TableSchema As varchar(500)
DECLARE @sql NVARCHAR(MAX)
SET @TableName = 'Table_Name'
SET @TableSchema = 'dbo'
SELECT @sql = STUFF((SELECT
'
UNION ALL
select ' + QUOTENAME(Table_Name,'''') + ' AS Table_Name,...
December 27, 2016 at 2:53 pm
Chris.McCarty (12/27/2016)
how to write a query - to exclude the field that starts with ING
select * form table where ID NOT LIKE 'ING%' ?
I want to exclude ING from all...
December 27, 2016 at 1:58 pm
AZ Pete (12/23/2016)
Two part question:
1) Given a table with N columns (N1, N2, N3, N4, ... etc) and assume that column N1 is a clustered PK and column N2 has...
December 27, 2016 at 12:25 pm
If the two tables are exactly the same, couldn't you just drop the empty table and rename the remaining table? Of course, that wouldn't get rid of your duplicates.
Another...
December 27, 2016 at 8:58 am
ben.brugman (12/23/2016)
But I do think I do understand the code....
December 27, 2016 at 8:44 am
Thom A (12/26/2016)
December 27, 2016 at 8:30 am
In my very small scale tests, it appears that using the XML count function is much slower than using the SQL count function. Try the following:
NumberOfDeleiveries ...
December 23, 2016 at 7:52 am
This seems to perform faster.
SELECT t.Value
FROM @Test t
GROUP BY t.Value
ORDER BY MIN(t.Id)
Drew
December 22, 2016 at 2:52 pm
Revenant (12/22/2016)
Manic Star (12/22/2016)
Grumpy DBA (12/22/2016)
Ed Wagner (12/22/2016)
FriedBrain
Fart
Wind
Talkers
December 22, 2016 at 2:02 pm
KGJ-Dev (12/22/2016)
Below the sample data
select 'verify1' union all
select 'verify1' union all
select 'verify1' union all
select 'chance1' union all
select 'chance1' union all
select 'chance2' union all
select 'chance2'
I need to get...
December 22, 2016 at 2:00 pm
Viewing 15 posts - 2,056 through 2,070 (of 4,087 total)