Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

database partitioning - SQL complex view for virtually showing data -


i have table following table.

---------------------------------- hour    location        stock ---------------------------------- 6        2000           20 9        2000           24 ---------------------------------- 

so shows stock against of hours in there change in quantity. requirement create view on table virtually show data (if stock not htere particular hour). data should shown

---------------------------------- hour    location        stock ---------------------------------- 6        2000           20 7        2000           20             -- same hour 6 stock 8        2000           20             -- same hour 6 stock 9        2000           24 ---------------------------------- 

that means if data not there particular hour should show last hour's stock having stock. , have table available hours 1-23 in column.

i have tried partition on method given below. think missing thing around requirement done.

select hour_number, case when total_stock null sum(total_stock) on ( partition location order current_hour rows  1 preceding  ) else total_stock end full_stock  (     select hour_number hour_number     hours_table -- refeerence table  hours 1-23     group 1 ) hours_ref left outer join ( sel current_hour  current_hour  , stock total_stock ,location location stock_table stock<>0 ) stocks on hours_ref.hour_number = stocks.current_hour 

this query giving hours stock null hours without data. looking @ ansi sql solution can used on databases teradata.

i thinking using partition on wrongly or there other way. tried case when needs kind of looping check hour stock.

i've run similar problems before. it's simpler make sure data need somehow gets database in first place. might able automate stored procedure runs periodically.

having said that, did consider trying coalesce() scalar subquery? (or whatever similar function dbms supports.) i'd try myself , post sql, i'm leaving work in 2 minutes.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -