Viewing 15 posts - 1,876 through 1,890 (of 1,922 total)
U need to do it using dynamic SQL mate..
please go through the following thread which is similar to ur request and find this post
http://www.sqlservercentral.com/Forums/Topic892483-338-1.aspx#bm892554
April 1, 2010 at 3:44 am
yes Arjun, i have to tweak ti for performance now.. i have added lot of garbage in that.. should clean the code.. once done, i wil post the optimized...
April 1, 2010 at 3:41 am
Thanks Arjun for an aliter code 🙂
Infact, i used a temporary table to old the data ranges and then joined it to get the ranges, much like your code...
April 1, 2010 at 3:27 am
Oh dave, how naive i have been.. the bug-pressure banded to me to do some astronimical calculations...thanks man.. thanks a lot..i did not even think in that line..
April 1, 2010 at 2:51 am
Dave, i guess the sample data made confusion.. the cost can be anything, say 1, 4, 7, 11, 13, 12, 22,27, 75,43 etc etc any integer number..
for your second...
April 1, 2010 at 2:17 am
Your code seems to work.. u missed out on the apostrophes at the end.. here is the working version (same ur code with slight modification)..
SET QUOTED_IDENTIFIER OFF
DECLARE @TABLE AS TABLE...
March 31, 2010 at 3:15 am
Post ur table structure in form of Create Table, and sample data in form of insert into scripts , image/visual representation of ur desired result, we will provide u a...
March 31, 2010 at 2:17 am
markjrouse (3/30/2010)
Hi SSC-Enthusiastic,
Mate, i guess u got my name wrong..i am ColdCoffee and SSC-Enthusiastic is the category what SqlServerCentral.com has assigned me to..
and for the function, it worked as ur...
March 30, 2010 at 9:05 am
Lowell, ur code works fine.. but i think u missed one part in mark's question..
Mark says that if there is match between the values present in the columns, then...
March 30, 2010 at 6:10 am
That function probably is not the best-perfomant, rather a clean-working one..
here is a table where i used taht function as computed column, it worked fine for me
create table testings
(
...
March 30, 2010 at 6:01 am
HI mark, here is your function
Sample table and data
if object_id('tempdb..#test') is not null
drop table #test
create table #test
(
A smallint,
B smallint,
C smallint,
D smallint,
E smallint
)
INSERT INTO #test
SELECT 1,2,3,5,4
UNION...
March 30, 2010 at 5:48 am
hi mark, can u pls post some visual examples of your table which has the count and your expected result.. i actually semi-understood ur question :(.. any help in this...
March 30, 2010 at 4:38 am
Please provide table structure, sample data, ur input , and YOUR DESIRED OUTPUT.. even if sentences in your post fail to educate us with ur requirement, the desired output part...
March 30, 2010 at 3:07 am
I appreciate your time for going thro the article and posting a table structure. Thanks 🙂
Whilst you were editing your post i was creating the table structure and sample data.
Table...
March 30, 2010 at 12:16 am
Please post ur table structure, sample data...
Go thro the following article to see how to post them
http://www.sqlservercentral.com/articles/Best+Practices/61537/
March 29, 2010 at 11:35 pm
Viewing 15 posts - 1,876 through 1,890 (of 1,922 total)