Viewing 15 posts - 316 through 330 (of 337 total)
joshtheflame (11/14/2010)
task_id.......task_name
-----------------------
1 ...
November 14, 2010 at 10:06 am
joshtheflame (11/14/2010)
November 14, 2010 at 9:50 am
First of all did you test the query I posted earlier?
The first query does exactly what the OP wants.It continues to execute rest of the script even though...
November 14, 2010 at 9:47 am
--Put it all together into a pivot query.
set @sql = 'SELECT Task_Name, ' + @columnnames + ' , Total FROM (';
November 14, 2010 at 9:41 am
OR
Try this
WHEN COUNT(customer_id) = convert(varchar(2),0) THEN 'No customers' ELSE COUNT(customer_id) END
PS - I haven't tested it
November 13, 2010 at 11:59 pm
When SET XACT_ABORT is OFF,in some cases only the Transact-SQL statement that raised the error is rolled back and the transaction continues processing. Depending upon the severity of the error,...
November 13, 2010 at 11:29 pm
You can change your @sql part to something like below.I cannot test it since you didn't post your table structure and sample data.
Notice the new column name "TaskTotal"
--Put...
November 13, 2010 at 1:06 pm
I wouldn't waste my time posting the answers for OP.He is applying for a job he is not eligible for as simple as that.
He should get the required experience or...
November 13, 2010 at 12:49 pm
set xact_abort off
go
CREATE TABLE #T(Cod VARCHAR(30)primary key)
INSERT INTO #T SELECT 'jkl'
INSERT INTO #T SELECT 'lmn' --Duplicate entry in input stream
INSERT INTO #T SELECT 'abc'
INSERT INTO #T SELECT 'lmn'...
November 13, 2010 at 12:33 pm
Also my solution will work for SQL 2005 and later.
I am assuming you are using a version greater than SQL 2000 since you have posted your question in SQL 2005...
November 9, 2010 at 12:30 pm
rko.37gags (11/9/2010)
Come on Dude....Just tell me.....what is "T" in that query
This is something called as a "derived table" which encapsulates the result of a SELECT statement in the FROM...
November 9, 2010 at 12:26 pm
rko.37gags (11/9/2010)
Thanks for ur reply....Some doubts..select * from
(
select *,row_number()over(partition by employeeid order by salary desc)rid from salary
)T where rid<=2
what is rid and T
You really wanna know?
I thought you would rather...
November 9, 2010 at 12:15 pm
Craig Farrell (11/9/2010)
Sachin.Nandanwar (11/9/2010)
rko.37gags (11/9/2010)
i attached the excel file
Now that's better.
Below is your query.
select * from
(
select *,row_number()over(partition by employeeid order by salary desc)rid from salary
...
November 9, 2010 at 12:12 pm
rko.37gags (11/9/2010)
i attached the excel file
Now that's better.
Below is your query.
select * from
(
select *,row_number()over(partition by employeeid order by salary desc)rid from salary
)T where rid<=2
November 9, 2010 at 12:05 pm
rko.37gags (11/9/2010)
Plz post me the query.....i didnt understand ur "Blah Blah"
OK.So here is the answer
select * from table
A "Blah Blah" answer for a "Blah Blah" question posted by "Blah...
November 9, 2010 at 11:44 am
Viewing 15 posts - 316 through 330 (of 337 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy