"patch" join? Hi all, I'm try to set up a mySQL database as a repository for some
experiment data. Most of it will be related to a sort of baseline. I
am keen to avoid replicating an entire dataset for what would be
fairly minor changes (one or two rows). Is there some kind of self
join I could use?
Example:
id scenario data patchid
1 1 100 0
2 1 100 0
3 1 100 0
4 1 100 0
5 1 100 0
6 1 100 0
7 1 100 0
8 1 100 0
9 1 100 0
10 1 100 0
11 2 110 3
12 2 130 4
13 3 200 7
so to access the baseline I would use
SELECT * FROM `table` where 'scenario' = 1
if scenario 2 is identical to the baseline data except that the third
value becomes 110 and the fourth value becomes 130 what would be the
best way of rendering the table?
I have a feeling its some kind of outer self join.
Any help is appreciated.
Dan |