Viewing 15 posts - 91 through 105 (of 110 total)
Hi
Maybe I missed something, but it seems like you already have the functions working inside View1 + View2 and what you need is just to combine those two sets into...
August 29, 2009 at 11:59 am
You might wanna try this trick:
SELECT
[TableName] = so.name,
[RowCount] = MAX(si.rows)
FROM
sysobjects so,
...
August 29, 2009 at 2:29 am
Since it is always the last record per person that you want to integrate, make use of the great 2005 feature : ROW_NUMBER() function.
For a full documentation, please refer to...
August 29, 2009 at 1:49 am
OK, since you're only looking for 3 consecutive days. it was hard for me to tell whether it is best to use recursive or regular CTE. I used regular to...
August 11, 2008 at 1:50 am
Hey GSquared
After a few more tests, I'm now facing a funny situation where my demo code runs fine, but my original code doesn't benefit from that improvement at the same...
July 9, 2008 at 9:50 pm
OK, then you may try one of the two:
1. - Raising the limit of the SQL to varchar(1000). After opening the XML test the DATALENGTH of the XML node...
July 9, 2008 at 1:28 pm
Hey GSquared...
I think I just solved my own puzzle...
I added the following filter to the end of the CTE:
WHERE CTE.permmask>A.RowMasks
WITH cte
(
TotalPrice,
RowID,
Combination,
PermMask
)
AS
(
SELECT
TotalPrice = cast(A.SalePrice as int),
RowID = CAST(BasketSaleRowID as...
July 9, 2008 at 12:22 pm
Hi Daniel
Are you trying to achieve data accuracy or an error handling mechanism?
Won't it be enough if you defined your field as VARCHAR(MAX)? You should enfornce length rules from within...
July 9, 2008 at 11:27 am
Hi
They force you to select unique items. Since this is a CTE that generates permutations, you should select only the combinations that contain all items and each item once only....
July 9, 2008 at 10:59 am
Hi
Could you please run the following command and post the results here?
sp_helpdb tempdb
July 8, 2008 at 8:34 am
It goes like this:
Any roduct can have one of the following prices:
1 - Ordinary price (no discount)
2 - some discount (X$, X%, etc)
3 - 1+1 (if you take two items...
July 7, 2008 at 10:20 am
For a moment, I thought you caught me...
No, unfortunately it will not return the right data, since the recursion will not take place correctly...
Just to make sure I tried it...
July 7, 2008 at 9:34 am
Hi
Thanks for replying...
The reason for the misterious select is that the demo data table is a bit more complex in real world, but this does not affect execution time...
July 7, 2008 at 8:47 am
are you running SQL 2005?
If so, you can use RECURSIVE CTE.
The very same example is shown all over google, as well as MSDN.
Look for it.
July 5, 2008 at 10:29 am
Correct!
and this is expected as the query first sorts by the partition column (contributor) and only then by the order by column (date published).
What you should do is add "order...
July 5, 2008 at 2:32 am
Viewing 15 posts - 91 through 105 (of 110 total)