Viewing 15 posts - 41,986 through 42,000 (of 59,067 total)
Tejas Shah (9/9/2009)
You can achieve the same by this query.
DECLARE @t TABLE( ID INT IDENTITY, data VARCHAR(100))
INSERT INTO @t(data) SELECT 'tejas@tejas.com;tejas@shah.com;tejas@SQLY@oga.com'
INSERT INTO @t(data) SELECT 'tejas@tejas.com;tejas@shah.com;'
;WITH CTE AS(
SELECT ID,
SUBSTRING(data,0, LEN(data)+1)...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 10:14 pm
dastagirid (9/9/2009)
this is users table
id name ...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 10:11 pm
Then you've done something wrong with the idea. Post the code and let's have a peek.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 9:40 pm
Heh... I figured. If it helps, I almost did the same thing until I realized there was no correlation between the sub-queries.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 9:31 pm
Sure... but, again, I wouldn't use PIVOT to do this. I would use pre-aggregated cross-tabs, instead. And the following article explains how to make them dynamically...
http://www.sqlservercentral.com/articles/Crosstab/65048/
My apologies for...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 9:29 pm
Seth is spot on... here's an article that explains the performance advantage of the method he used...
http://www.sqlservercentral.com/articles/T-SQL/63681/
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:56 pm
Like this...
SELECT e.*
FROM dbo.Employees e
INNER JOIN dbo.Students s
ON e.Name = s.Name
AND e.Age =...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:52 pm
The current query (either one) will return all employees who's name and age are in the student table.... they just might not be on the same row, though because there...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:47 pm
The PIVOT code in the following article will do it...
http://www.sqlservercentral.com/articles/T-SQL/63681/
... and, with any luck at all, it will convince you to never use PIVOT to do such a thing.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:33 pm
Ummm... I really want my doctor to know the differerence between a transverse colon and a descending colon even though they're both just a part of the same large intestine...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:19 pm
Ah dang... thanks for the feedback, Yumi. I've gotta remember to read the name of the forum I'm trying to answer the question on. I was thinking pure...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 8:04 pm
Grant Fritchey (9/9/2009)
WHOOP!I'm sitting the same room as Jeff Moden. My IQ has gone up. Who needs a problem sovled?
:blush: Heh... that's odd. I was going to say...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 7:53 pm
Eggsactly...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 1:06 pm
Actually, we've gotten a bit off track. I don't mind people asking questions on forums... in fact, I recommend it because there are so many great folks out there...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 1:02 pm
Shall we know the real name of such a hard working individual that spends time rearranging people's last names to be offensive words? I did initially try to make...
--Jeff Moden
Change is inevitable... Change for the better is not.
September 9, 2009 at 9:45 am
Viewing 15 posts - 41,986 through 42,000 (of 59,067 total)