I currently have one table to hold ForecastAdjustmentTypes
Now each forecast adjustment are recorded differently.
Thus, attached to different schema.
For example some adjustments are done at the population level and some are done at the drug level.
Is it best practice to keep the type names...
it is fast. I am trying to be anal about indexes and normalization.
I broke one normalization rule. We have drugs that can added as an emerging drug, but they are added 3 different ways...
Emerging brand
Emerging Brand from Existing Brand
Emerging Generic from Either EmergingBrand or...
Our company wants to view data from a normalized table in a pivoted grid. Not only that, they need to be able to update the values as well. Thus, I created a pivoted stored procedure which uses dynamic sql b/c the crap pivoted function doesn't read the column values.
Now updating the grid in...
it did. Any recommendations on make my query better, readable etc.? I am new to this thus want to make sure the next person who reads this won't pull his hair, lol.
no it can have more than one record, so my result will be like
Pricing drug groupid Geographyname adjustment value
1 usa null
2 france .58
3 uk null
This is what I came...
Yep, query 2 has a field called Adjustment value, the table
ForecastAdjustment has fields PricingDrugGroupId and ForecastPeriodTimelineID.
My Final results need to be
Pricingdruggroupid
ForecastPeriodtimelineid,
Pricingdrugname,
Geographyname,
PeriodTimelineDate
AdjustmentValue (from...
Query 1 (I want all the results and only matching results from query 2)
They will be joined on PricingDrugGroupID and ForecastPeriodTimelineID eventhough query 2 does not return these columns it is in the table.
Query 1 code...
SELECT dbo.PricingDrugGroup.PricingDrugGroupID...
My comments are getting replaced by system commment?
How do I override this? Is it a template or something?
/****** Object: StoredProcedure [MarketForecaster].[Population_SelectByVersionID] Script Date: 12/16/2008 14:53:12 ******/
Does this also work?
SELECT PricingDrugID, BrandGeneric, Country
FROM Table1
WHERE (((Table1.PricingDrugID) Not In (select PricingDrugID FROm Table1 where BrandGeneric = 'generic'))) OR (((Table1.Country) Not In (select Country FROm Table1 where BrandGeneric = 'generic')))
It seems to return...
Here is my table
DrugId | BrandGeneric | Coutnry
=============================================
1 brand US
1 brand France
1 generic US
1 generic France
1...
I am having a tough time on where to begin with this...
PricingDrugGroupID | PricingDrugName | Country | BrandGeneric
===========================================================================
1 PricingDrug A USA BRAND
2...
thanks, it just seems like a simple update to the t-sql language to allow this. I mean if MS Access allows this, then t-sql certainly can, repeating the columns in calculations can be quite annoying and long, especially when I have like 5 calculated columns referencing other calculated columns...
In MS Access you can reference a calculated fields by the alias name: example:
SELECT [sales]/[unit] AS UnitSales, [UnitSales]-1 AS UnitSalesLessOne
FROM Table1;
Can this be done in t-sql, I get an invalid field name error?
If not then that is crappooo
well I am concerned I am introducing more joins than necessary. At max I will only have 12 models.
I think a full normalization would consist of 5 tables. All erosion models are year based and only last for the first 4 years.
Should I break out the time info into a separate table to account...
thanks everyone. Points well taken.
So my final tables would be this.
ErosionModel
------------
ErosionModelID
ErosionName
ErosionRate (should i have a seperate table for slow, medium, fast values?)
Geography
----------
GeographyID
GeographyName
GeographyErosionModel
--------------------...
I have the following data, and I was wondering if I should create a ErosionRateType and ErosionModel (with name and rate type) table or just leave the data as is since we are only going to have 3 erosion models at max. Btwm geography is an id field to the geography table.
Example data...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.