Skip to content

Instantly share code, notes, and snippets.

View tyl3r's full-sized avatar
🐉
kap5ule.com

tyl3r

🐉
kap5ule.com
View GitHub Profile
@latompa
latompa / gist:44489
Created January 7, 2009 22:51
update with correlated query
-- I had an existing products table, and needed to denormalize two fields for faster sorting.
-- The number of rates and total rating is currently in a ratings table, and needs to be copied to products
create table products (
id integer,
name varchar(16),
ratings_count integer,
total_rating integer
);