Viewing 15 posts - 241 through 255 (of 516 total)
Toreador (11/28/2012)
I didn't understand the question at all, so guessed. Having read the explanation I was none the wiser.So I tried it, and the execution plan was empty.
confused.com
+1
Same was the...
November 28, 2012 at 2:51 am
Lynn Pettis (11/27/2012)
Lokesh Vij (11/27/2012)
Jeff Moden (11/27/2012)
Here's an article that explains the base method that Lynn is using (sans the formatting).
Just one doubt: Is this method optimized enough of such...
November 27, 2012 at 9:34 pm
Lynn Pettis (11/27/2012)
Lokesh Vij (11/27/2012)
Jeff Moden (11/27/2012)
Here's an article that explains the base method that Lynn is using (sans the formatting).
Just one doubt: Is this method optimized enough of such...
November 27, 2012 at 9:33 pm
I was completely not able to get this question!
Could have been phrased better..
November 27, 2012 at 9:15 pm
Kindly post some sample SQL that would definitely help!
Do read about best-practices link underneath my signature. That will always help you to get response to your queries in timely manner.
Thanks!
November 27, 2012 at 5:47 am
Jeff Moden (11/27/2012)
Here's an article that explains the base method that Lynn is using (sans the formatting).
Just one doubt: Is this method optimized enough of such problems? or that varies...
November 27, 2012 at 5:41 am
Thanks Lynn and Jeff for clarifying 🙂
Undoubtably this method seems to be the best fit for consecutive dates!
November 27, 2012 at 5:36 am
Lynn Pettis (11/27/2012)
Create table #Input
(LocationName varchar(20), ContactName varchar(20), AppointmentDate date)
Insert into #Input
values
('Business1', 'C1', '11/12/2012'),
('Business1', 'C1', '11/13/2012'),
('Business1', 'C1', '11/14/2012'),
('Business1', 'C1', '11/15/2012'),
('Business1', 'C1', '12/15/2012'),
('Business1',...
November 27, 2012 at 12:38 am
select LocationName,ContactName,
CASE CAST (MIN(AppointmentDate) as VARCHAR(16))
WHEN CAST (MAX(AppointmentDate) as VARCHAR(16)) THEN CAST (MIN(AppointmentDate) as VARCHAR(16))
ELSE
CAST (MIN(AppointmentDate) as VARCHAR(16))+' TO '+CAST (MAX(AppointmentDate) as varchar(16))
end AppointmentDate
from #Input
group by LocationName,ContactName, YEAR(AppointmentDate),MONTH(AppointmentDate)
November 26, 2012 at 10:21 pm
Good question indeed!
The result would be same if, I replace the second insert statement with 0 (zero) from space.
insert into #test
select 1,'malli',null
union
select 2,'reddy',0
union
select 3,'test',getdate()
November 26, 2012 at 9:43 pm
SQL Kiwi (11/26/2012)
November 26, 2012 at 5:18 am
If this is a simple debit/credit problem, here is one of the way to solve. I have tried creating a sample table called "Account".
create table Account(id int identity, F1 int,...
November 26, 2012 at 3:00 am
SQL Kiwi (11/25/2012)
I like this way of expressing the solution:
SELECT t1.ID FROM dbo.T1 AS t1
UNION
SELECT t2.ID FROM dbo.T2 AS t2
EXCEPT
SELECT t1.ID FROM dbo.T1 AS t1
INTERSECT
SELECT t2.ID FROM dbo.T2 AS t2;
One...
November 26, 2012 at 2:34 am
Thanks for a good question to start the week!
November 25, 2012 at 10:18 pm
Its is always wonderful to learn new things about SS 2012. Thanks for posting this question 🙂
November 19, 2012 at 9:38 pm
Viewing 15 posts - 241 through 255 (of 516 total)