Viewing 15 posts - 5,191 through 5,205 (of 10,143 total)
wafw1971 (2/20/2013)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 20, 2013 at 6:18 am
wafw1971 (2/20/2013)
Its alright I have figured it out:...
DwainC already figured it out for you:
SELECT
ArrivalDate,
BookingDate = DATEADD(day,
-(1 + ABS(checksum(NEWID())) % 90),
ArrivalDate)
FROM Bookings
ORDER BY ArrivalDate
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 20, 2013 at 5:46 am
DROP table #empl
CREATE TABLE #empl
(
row_id int,
ename varchar(120),
job varchar(120),
sal varchar(100)
)
INSERT #empl VALUES
('4','ram','IT','60000'),
('4','ram','IT','60000'),
('4','ram','IT','60000'),
('4','ram','IT','60000');
WITH OrderedData AS (
SELECT row_id, ename, job, sal,
rn = ROW_NUMBER() OVER(PARTITION BY row_id, ename, job, sal...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 20, 2013 at 12:54 am
akberali67 (2/18/2013)
Chris, thanks again for all the help. Truly thanks doesnt do it but from the bottom of my heart I can not thank you for the help.
Gosh - thanks!...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 19, 2013 at 1:00 am
-- Collect the matches
SELECT l.ID ;
FROM LARGE l ;
INNER JOIN small s ;
ON s.ID <> l.ID ;
AND LARGE.Z5 = small.z5 and Large.ln = small.ln and Large.fn = small.fn...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 19, 2013 at 12:57 am
Paul White (2/18/2013)
ChrisM@Work (2/11/2013)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 18, 2013 at 2:59 am
sqldba_newbie (2/16/2013)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 18, 2013 at 1:21 am
Sachin Vaidya (2/14/2013)
Your response definitely shows a path to move ahead, thanks a lot for that.
But on the other side, it was very rude. It will discourage people from...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 15, 2013 at 1:09 am
Another way:
SELECT abc.*
FROM dbo.abc abc
WHERE NOT EXISTS (SELECT 1 FROM dbo.xyz)
OR abc.id IN (SELECT ID FROM dbo.xyz)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 13, 2013 at 6:56 am
mpdillon (2/12/2013)
...since it didn't use the lookup table, I was not able to fully implement it....
Which lookup table, Pat? The article (and the discussion) should provide you with all the...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 12, 2013 at 5:55 am
ScottPletcher (2/11/2013)
For best performance,Cluster the table by
LAST_DAY_OF_MONTH
and not the dopey identity column. If you still need the identity (??), you can leave it as the nonclustered pk.
+1
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 12, 2013 at 12:57 am
The option you have commented out will never be selected because there's an option before it in the CASE construct which will:
CASE
WHEN mb.name LIKE...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 11, 2013 at 9:54 am
You're welcome. Thank you for the feedback.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 11, 2013 at 9:52 am
gparamasivamit (2/11/2013)
i need answer
42 of course. Doesn't everybody know this now?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 11, 2013 at 9:49 am
CassieF (2/11/2013)
ho hum..SQL Server 2000 - 8.00.2039 (intel x86)
Heh no worries. Try this;
SELECT
MarketName,
COUNT(*)
FROM (
SELECT --top 100 percent
f.FormName,
m.MarketName
FROM Form f
INNER JOIN FormMarkets_Link l
ON f.FormID =...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
February 11, 2013 at 9:45 am
Viewing 15 posts - 5,191 through 5,205 (of 10,143 total)