October 14, 2009 at 12:56 pm
s ss (10/14/2009)
My saying "within 5mins" meant the OP asked a question without table definitions, insert scripts and saying it's urgent still got an answer without anyone asking him to google it (which was my first thought) or asking why it was urgent.
To be honest , it makes no difference to me if someone posts a question as urgent or not.
If it really is urgent, your business is suffering and an online forum is your last resort, should you really be charged with that level of responsibility ?
Basically ill answer a question with code if
a) i can think of an answer off the top of my head
b) im really intrigued by the question and i think ill find it a challenge
Yes, that means that the questions in the middle wont get as much attention, I reserve that right.
If i can think of a link or two, which I think is handy then ill post them.
October 14, 2009 at 1:40 pm
GSquared (10/14/2009)
s ss (10/14/2009)
GilaMonster (10/14/2009)
s ss (10/14/2009)
I was just wondering (in case I may have some questions in the future) what's so different about this post: Delete Duplicates then this one: query to modify ....
I can't speak for anyone else, but speed of reply in my case involves a number of factors, including how often I check the forums (biggest factor), is the category one that I feel I can possibly contribute to (second), and does the subject line catch my interest (third). After those combine to determine whether/when I look at the post, a lot depends on how well written the post is, how long it is, and my estimation of effort for helping out on it.
If I open up a post, and it looks like it's going to take more than a few minutes to read, and longer than that to figure out what's being requested, quite often I'll move on to another post. I have a limited amount of time to spend on posts here, and if I waste 20 minutes trying to figure out what's being requested, that's probably 4 or 5 people I could have helped on simpler/better-written posts.
If I read and understand the post, and think it'll take hours of work to sort out, I'll pass it up, or give a short answer that I hope will point the person in the direction of solving it themselves. Two reasons: First, I don't have time for that kind of thing most days; Second: I'm stealing bread from the mouths of consultants and other professionals quite unfairly. Some days, neither of those matters to me, and I'll spend hours on an intriguing problem. If the problem means I get to fire up some extra brain cells that are getting lazy from the lack of stimulus in my own job, I can end up spending days on it.
...
I think these are probably fairly accurate criteria for any volunteer responding to a post in SSC.
Responses to questions are largely a timing issue, interest level, and ability to contribute value to the response (depending on time required).
As for the query to modify, I think a turnoff to the query is that no query was provided (and thus nothing to modify). If there had been a query provided, we could have seen what had been tried - and then actually provided a modified query. Maybe that is just semantics.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 14, 2009 at 2:02 pm
s ss (10/14/2009)
My saying "within 5mins" meant the OP asked a question without table definitions, insert scripts and saying it's urgent still got an answer without anyone asking him to google it (which was my first thought) or asking why it was urgent.
It was simple enough it didn't actually need either table defs or sample data to answer. It was also a lot more readable than your other one.
Constant cries of 'urgent, urgent!!!' bother some people more than others and for some how much it bothers them depends on their mood.
Can anyone tell me how he should have asked the question (without the table def and insert scripts) so that he could also have gotten a solution?
I need some help in getting data into a particular form. I have a table with three columns in. The first column is a code, the other two are strings.
<insert table def and sample code here>
I need to display this so that the the code is repeated on two rows, first row with the 1st string column and then with the second string column. Like this:
<insert example of how the data should have looked>
(That's based on my understanding of the question, I may be totally wrong in what he wants. If I'm right, this is very simple to do, union the table with itself)
SELECT Code, StrCol1, 1 as OrderCol FROM Table
Union All
SELECT Code, StrCol2, 2 as OrderCol FROM Table
Order by Code, OrderCol
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2009 at 2:06 pm
That's how I interpreted it, Gail. This was my quick-and-dirty solution.
declare @sample table (channel varchar(5), line_of_bus varchar(5), prod_nm varchar(20))
insert into @sample
select 'all', 'C1','last year p&c' union all
select 'all', 'D1','busi module' union all
select 'all', 'd1','bus term' union all
select 'IA', 'c1','exp cum total' union all
select 'IA','D1','busi module'
-- everything above this line should be provided by the person asking the question
-- followed by the example of what the output should look like (this was given)
-- one solution: an unpivot would probably be more performant
;with cte1 (rowID,channel,line_of_bus, prod_nm) as
(select row_number() over(order by channel,line_of_bus),* from @sample)
,cte2 (sortColumn, rowID, channel, line_of_bus) as
(
select 1,rowid,channel,line_of_bus from cte1 union all
select 2,rowid,channel,prod_nm from cte1
)
select channel,line_of_bus from cte2
order by rowID, sortColumn
May The Thread forgive me for actually posting code here.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 2:12 pm
Bob Hovious 24601 (10/14/2009)
May The Thread forgive me for actually posting code here.
Go meditate on your failures, say 20 'Hail SQL's and sin no more.
(apologies to any Catholics, no insult intended)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2009 at 2:19 pm
I haz two tables and no question
http://www.sqlservercentral.com/Forums/Topic803081-338-1.aspx
Some else can have the pleasure of this one. I'm going to spend an hour trying to conquer the galaxy, then going to bed.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2009 at 2:24 pm
GilaMonster (10/14/2009)
I haz two tables and no questionhttp://www.sqlservercentral.com/Forums/Topic803081-338-1.aspx
Some else can have the pleasure of this one. I'm going to spend an hour trying to conquer the galaxy, then going to bed.
Have fun storming the castle... er, conquering the galaxy. The second shift will take it all on.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 14, 2009 at 2:37 pm
Which galaxy?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
October 14, 2009 at 2:37 pm
Looks like you all are doing fine without me so far, haven't seen a cry for a Saint yet. We are about a half hour outside of Columbia SC. Cold and raining, but I don't care what the weather is right now, tomorrow I get see Kassondra.
I'll let you all know how things go tomorrow, may be worth a blog since I haven't done that in a while.
October 14, 2009 at 2:40 pm
CirquedeSQLeil (10/14/2009)
As for the query to modify, I think a turnoff to the query is that no query was provided (and thus nothing to modify). If there had been a query provided, we could have seen what had been tried - and then actually provided a modified query. Maybe that is just semantics.
Good point Jason.:-)
October 14, 2009 at 2:44 pm
Matt Whitfield (10/14/2009)
I would also say that a pre-requisite for a question is at least having typed it into Google first. While lmgtfy.com is funny, it gets boring after about 40 times.🙂
speak for yourself...:hehe:
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
October 14, 2009 at 2:47 pm
GilaMonster (10/14/2009)
I need some help in getting data into a particular form. I have a table with three columns in. The first column is a code, the other two are strings.<insert table def and sample code here>
I need to display this so that the the code is repeated on two rows, first row with the 1st string column and then with the second string column. Like this:
<insert example of how the data should have looked>
(That's based on my understanding of the question, I may be totally wrong in what he wants. If I'm right, this is very simple to do, union the table with itself)
SELECT Code, StrCol1, 1 as OrderCol FROM Table
Union All
SELECT Code, StrCol2, 2 as OrderCol FROM Table
Order by Code, OrderCol
See you guys are so GOOD you don't need any additional info. 😀
October 14, 2009 at 2:49 pm
Bob Hovious:
We're developing code in the T-SQL forums, it's not like a hospital emergency room .
This made me laugh, as I have a sneaking suspicion that some of you buggers would be posting on SSC while you're in the freakin' ER. *cough*RBarryYoung*cough*
---------------------------------------------------------
How best to post your question[/url]
How to post performance problems[/url]
Tally Table:What it is and how it replaces a loop[/url]
"stewsterl 80804 (10/16/2009)I guess when you stop and try to understand the solution provided you not only learn, but save yourself some headaches when you need to make any slight changes."
October 14, 2009 at 2:53 pm
Bob Hovious 24601 (10/14/2009)
That's how I interpreted it, Gail. This was my quick-and-dirty solution.
declare @sample table (channel varchar(5), line_of_bus varchar(5), prod_nm varchar(20))
insert into @sample
select 'all', 'C1','last year p&c' union all
select 'all', 'D1','busi module' union all
select 'all', 'd1','bus term' union all
select 'IA', 'c1','exp cum total' union all
select 'IA','D1','busi module'
-- everything above this line should be provided by the person asking the question
-- followed by the example of what the output should look like (this was given)
-- one solution: an unpivot would probably be more performant
;with cte1 (rowID,channel,line_of_bus, prod_nm) as
(select row_number() over(order by channel,line_of_bus),* from @sample)
,cte2 (sortColumn, rowID, channel, line_of_bus) as
(
select 1,rowid,channel,line_of_bus from cte1 union all
select 2,rowid,channel,prod_nm from cte1
)
select channel,line_of_bus from cte2
order by rowID, sortColumn
May The Thread forgive me for actually posting code here.
Thanks for posting the code Bob. Hope your meditation goes well 🙂
October 14, 2009 at 2:57 pm
jcrawf02 (10/14/2009)
Bob Hovious:
We're developing code in the T-SQL forums, it's not like a hospital emergency room .
This made me laugh, as I have a sneaking suspicion that some of you buggers would be posting on SSC while you're in the freakin' ER. *cough*RBarryYoung*cough*
You might be on to something there. Take Lynn for example. Right now driving down the road on vacation and takes the time to post us on the trip and check the forum. 😎
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 15 posts - 8,566 through 8,580 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply