Viewing 15 posts - 5,476 through 5,490 (of 10,144 total)
SELECT
nameid,
telephone1 = MAX(CASE WHEN rn = 1 THEN telephone END),
telephone2 = MAX(CASE WHEN rn = 2 THEN telephone END),
telephone3 = MAX(CASE WHEN rn = 3 THEN...
October 4, 2012 at 8:36 am
TheSQLGuru (10/4/2012)
PRIMARY KEY (ID),
UNIQUE (ID))
2) I can probably count on...
October 4, 2012 at 8:30 am
Do you have another column in your existing table to identify what type of phone number it is? Mobile/work/home etc?
October 4, 2012 at 8:08 am
PiMané (10/4/2012)
ChrisM@Work (10/4/2012)
SSC has just the article for you, right here[/url]. No need to redesign the wheel just yet 😉My initial thoughts are right then 🙂
Thx,
Pedro
Reckon so 😉
October 4, 2012 at 7:58 am
dwain.c (10/4/2012)
Eugene Elutin (10/4/2012)
ChrisM@Work (10/4/2012)
Eugene Elutin (10/4/2012)
ChrisM@Work (10/4/2012)
No undocumented vapourtables, no sort:
SELECT n = a.n+b.nFROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)
CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)
😉
No sort? I would suggest to add ORDER BY, otherwise order is not...
October 4, 2012 at 7:47 am
Eugene Elutin (10/4/2012)
ChrisM@Work (10/4/2012)
Eugene Elutin (10/4/2012)
ChrisM@Work (10/4/2012)
No undocumented vapourtables, no sort:
SELECT n = a.n+b.nFROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)
CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)
😉
No sort? I would suggest to add ORDER BY, otherwise order is not guaranteed,...
October 4, 2012 at 7:46 am
PiMané (10/4/2012)
ChrisM@Work (10/4/2012)
October 4, 2012 at 7:30 am
Eugene Elutin (10/4/2012)
ChrisM@Work (10/4/2012)
No undocumented vapourtables, no sort:
SELECT n = a.n+b.nFROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)
CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)
😉
No sort? I would suggest to add ORDER BY, otherwise order is not guaranteed, so you may...
October 4, 2012 at 7:01 am
PiMané (10/4/2012)
PiMané (10/4/2012)
ChrisM@Work (10/4/2012)
Post the actual execution plans as .sqlplan attachments. It's difficult to determine anything useful from these figures.Thanks... here it is.
Pedro
The plans are almost the same except for...
October 4, 2012 at 6:57 am
No undocumented vapourtables, no sort:
SELECT n = a.n+b.n
FROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)
CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)
😉
October 4, 2012 at 6:50 am
This has to be homework because it's very simple.
Try ROW_NUMBER() OVER (PARTITION BY something ORDER BY somethingelse)
You will need to set it up as a CTE or derived table in...
October 4, 2012 at 6:11 am
This should be close.
MERGE [DBname].[dbo].[Space] AS target
USING [DBname].[dbo].[RawData_Space] AS source
ON target.SPACE_ID = source.SPACE_ID
WHEN MATCHED THEN
...
October 4, 2012 at 6:08 am
maida_rh (10/4/2012)
E.g :
Select LTRating ,RHDate from Accounts...
October 4, 2012 at 5:38 am
Post the actual execution plans as .sqlplan attachments. It's difficult to determine anything useful from these figures.
October 4, 2012 at 5:20 am
deepakagarwalathome (10/3/2012)
Thanks for that!I fully understand what you are trying to do with the CTE's. I have run the query with the CTE's.
The problem, however, remains the same, that...
October 4, 2012 at 5:13 am
Viewing 15 posts - 5,476 through 5,490 (of 10,144 total)