Viewing 15 posts - 166 through 180 (of 287 total)
Michael Valentine Jones (11/6/2009)
The typical de-normalization process is this:1. Create database design without knowing or attempting to follow normalization rules.
2. Claim that you de-normalized the design for performance.
3. Profit! 🙂
November 6, 2009 at 11:04 am
Michael Valentine Jones has the correct solution so I'd suggest you change your view accordingly. But, since you already have the view you can change your select from the view...
October 14, 2009 at 4:50 pm
sol-356065 (10/12/2009)
@Mark-101232:The "first row" means the row which come first in a group.
In my sample, that is the first row of "A" group.
SQL does not have a "first" row. Sets...
October 14, 2009 at 2:45 pm
You could try with and with out a derived table and see if you get a different query plan or execution time. But, it shouldn't make any difference to SQL.
September 4, 2009 at 12:10 pm
iruagawal (9/3/2009)
September 3, 2009 at 10:54 am
Is thr FROM clause ommited or missing?
igngua (9/2/2009)
I dont know why this trigger aint working.
Scenario:
Data gets inserted, trigger gets fired, i take all the data from INSERTED...
September 2, 2009 at 2:39 pm
I see what you want to do now.. Try something like this:INSERT INTO _tbl_Target (account_name,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)
SELECT
ACCOUNT_NAME,
SUM(CASE WHEN Period_name = 'Jan' then AMOUNT else 0 END) AS JAN,
SUM(CASE WHEN Period_name =...
September 2, 2009 at 2:27 pm
As montioned there is no order in a set, so I added an IDENTITY column to mainatain that order. In the real world you would have some sort of order...
September 2, 2009 at 1:20 pm
If you wanna post some sample data and expected output, I'm sure we can help you come to a reasonable solution:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 2, 2009 at 12:31 pm
As far as I know you'd have to return N number of separate columns or use dynamic sql. But, if you are trying to do a pivot you might be...
September 2, 2009 at 11:29 am
Lynn Pettis (9/2/2009)
select top 1000
convert(varchar(30), convert(money, isnull(sum(shippingcost),0))) as "Total Navigation"
from
dbo.NavAttempts
The problem is...
September 2, 2009 at 11:07 am
I don't think it helps your particular issue, but you could change the order of COALESE and SUM to get rid of that warning message:select top 1000 convert(varchar(30), sum(coalesce(shippingcost,$0.0)))...
September 2, 2009 at 9:47 am
kabaari (9/2/2009)
Is there a reason this statement is returning NULL?
WHERE tbl_Assembly_Holds.WorkOrder = LEFT(tbl_Assembly_Production.WorkOrder, 5) AND tbl_Assembly_Production.dateProd Between '8/3/2009' AND '8/31/2009' AND tlkp_Defects.Defect_Title = 'Jar To Cover Leak' AND...
September 2, 2009 at 9:27 am
Strange. any chance the SUM is larger than a MONEY datatype can hold?
Why convert money to money?
select top 1000 convert(varchar(30), coalesce(sum(shippingcost),$0.0)) as "Total Navigation"
from dbo.NavAttemptsAlso, why convert...
September 1, 2009 at 5:01 pm
Viewing 15 posts - 166 through 180 (of 287 total)