Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. create table my_statistics (
  2. id int not null primary key auto_increment,
  3. version int not null,
  4. -- other columns with your data
  5. );
  6.  
  7. create table stats_version (current_version int); -- holds just one row
  8.  
  9. create view stats as
  10. select *
  11. from stats_version v
  12. join my_statistics s on s.version = v.current_version);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement