Click here to Skip to main content
15,925,602 members
Home / Discussions / Database
   

Database

 
AnswerRe: Cassandra or MySQL? Pin
Mycroft Holmes7-Jan-13 12:01
professionalMycroft Holmes7-Jan-13 12:01 
AnswerRe: Cassandra or MySQL? Pin
PIEBALDconsult7-Jan-13 12:53
mvePIEBALDconsult7-Jan-13 12:53 
QuestionOracle Application expres Pin
Fred Andres6-Jan-13 11:52
Fred Andres6-Jan-13 11:52 
AnswerRe: Oracle Application expres Pin
Chris Meech6-Jan-13 13:57
Chris Meech6-Jan-13 13:57 
GeneralRe: Oracle Application expres Pin
Fred Andres7-Jan-13 8:32
Fred Andres7-Jan-13 8:32 
AnswerRe: Oracle Application expres Pin
Shameel7-Jan-13 3:45
professionalShameel7-Jan-13 3:45 
GeneralRe: Oracle Application expres Pin
Fred Andres7-Jan-13 8:32
Fred Andres7-Jan-13 8:32 
QuestionSQL paging with search Pin
Lance Parker6-Jan-13 2:11
Lance Parker6-Jan-13 2:11 
AnswerRe: SQL paging with search Pin
jschell6-Jan-13 5:19
jschell6-Jan-13 5:19 
GeneralRe: SQL paging with search Pin
Lance Parker7-Jan-13 8:23
Lance Parker7-Jan-13 8:23 
GeneralRe: SQL paging with search Pin
jschell7-Jan-13 9:12
jschell7-Jan-13 9:12 
QuestionI want to ask query related to mysql Pin
manisharathore5-Jan-13 7:32
manisharathore5-Jan-13 7:32 
AnswerRe: I want to ask query related to mysql Pin
Mycroft Holmes5-Jan-13 11:03
professionalMycroft Holmes5-Jan-13 11:03 
Questionproblem in ado.net with access 2010 Pin
Achilles843-Jan-13 23:20
Achilles843-Jan-13 23:20 
AnswerRe: problem in ado.net with access 2010 Pin
Mycroft Holmes4-Jan-13 13:55
professionalMycroft Holmes4-Jan-13 13:55 
Questionhow to cast real data type in sql server 2005 Pin
Auf Klarung2-Jan-13 22:55
Auf Klarung2-Jan-13 22:55 
QuestionRe: how to cast real data type in sql server 2005 Pin
Eddy Vluggen4-Jan-13 22:52
professionalEddy Vluggen4-Jan-13 22:52 
QuestionSql server like clause Pin
rubonkumar28-Dec-12 4:44
rubonkumar28-Dec-12 4:44 
AnswerRe: Sql server like clause Pin
Richard MacCutchan28-Dec-12 6:05
mveRichard MacCutchan28-Dec-12 6:05 
AnswerRe: Sql server like clause Pin
PIEBALDconsult28-Dec-12 6:38
mvePIEBALDconsult28-Dec-12 6:38 
GeneralRe: Sql server like clause Pin
Mike Meinz28-Dec-12 6:49
Mike Meinz28-Dec-12 6:49 
GeneralRe: Sql server like clause Pin
rubonkumar28-Dec-12 19:08
rubonkumar28-Dec-12 19:08 
AnswerRe: Sql server like clause Pin
rajarao3044-Jan-13 0:50
rajarao3044-Jan-13 0:50 
QuestionDatabase design question Pin
David Crow27-Dec-12 15:22
David Crow27-Dec-12 15:22 
AnswerRe: Database design question Pin
PIEBALDconsult27-Dec-12 15:52
mvePIEBALDconsult27-Dec-12 15:52 
Instead of having one price record per item, have many records with history so you can see what the price was when the order was placed.

Something like:
Item: ItemId,Name,Description,Supplier,etc.

1,Widget,A standard widget,Widget Co,...

ItemPrice: PriceId,ItemId,FromDate,ToDate,Price

1,1,2012-01-01,2012-07-01,1.00<br />
2,1,2012-07-01,null,1.50


When a new price is added, the FromDate of the new record and the ToDate of the previous price are set as Now.
You find the current price by WHERE ToDate IS NULL
To find a price for an order you can use WHERE orderdate BETWEEN FromDate and ISNULL(ToDate,Now)
You may add NextPrice and PreviousPrice fields if you need to do a lot of lookups.

(Specific syntax depends on the particular database in use.)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.