Viewing 15 posts - 4,141 through 4,155 (of 5,109 total)
The following works:WITH Groups AS(
SELECT GG.groupname,
GT.guidREP,
GG.guidID
FROM GuidGroup GG
JOIN GuidTable GT ON GG.guidID = GT.guidID)
SELECT G.groupname,
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 4:49 am
Ok, what would you return if a GROUP had 3 GUID's related to it, of which 1 had a value of NULL?
Say for example Guid1 had a value...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 4:08 am
Thanks for providing DDL and sample data. Can you explain why group 1 returns Alex twice, and group 2 John? What is your logic?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 3:46 am
That
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 3:22 am
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 3:10 am
Table variable aren't great. Regardless of how many rows you're going to INSERT into them, the query planner will always estimate the number of rows within the table as 1....
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 2:35 am
I would firstly get your data into something of a usable format. I've used a WITH statement, but I advise actually updating your table structure. I'm also assumed that the...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 3, 2017 at 2:08 am
Testing the following on both SQL Server 2016 Dev (Windows 10), and SQL vNext (Ubuntu 16.04.2) returns what I would expect:
Msg 208, Level 16, State 1,...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 11:52 am
Hugo Kornelis - Thursday, March 2, 2017 8:45 AMWho is General Failure, and why is he reading my hard disk?
This reminded...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 9:12 am
My situation is similar. I have a good number of inactive users that need...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 9:03 am
select*
into new_table
from old_table
But received this warning :
Warning: Null value is eliminated by an...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 8:45 am
Try:USE [WorkLSC];
GO
SELECT *
INTO [DBO.T_NEWTABLE]
FROM [WorkLSC].[dbo].[vw_OLDTABLE];
GO
Note, however, it is terrible practice naming a table with the prefix "DBO.". I would suggest...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 8:41 am
CREATE TABLE #Metrics (MetricID VARCHAR(5),Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 7:34 am
Well... I have a solution, it's dirty, it's not pretty,it's probably got an hideous query plan, but for the 2 examples you gave, it works. If you ever have more...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 7:13 am
I actually wonder why you would want to delete it in the first place anyway. If it's a foreign key, then those other tables are relying on it for referential...
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 2, 2017 at 5:00 am
Viewing 15 posts - 4,141 through 4,155 (of 5,109 total)