"select * from newsletters
left join
(preferences,
(select * from users where users.id=#{id}) as user)
on (preferences.newsletter_id=newsletters.id
and preferences.user_id=user.id)"
dinsdag 25 september 2007
Three table conditional left join
doing a three table conditional left join in mysql using a subquery
maandag 24 september 2007
mysql with create_at and modified_at timestamps
Creating a table with two timestamps, one default and one on update, creates an error in mysql.
using default 0, solves this problem, but you need to insert a 0 to get the desired result of a created at timestamp.
Rails has some timestamping conventions/methods of its own, but i think this kind of intelligence should reside within the database, not in a web framework.
using default 0, solves this problem, but you need to insert a 0 to get the desired result of a created at timestamp.
create table example(
id int not null auto_increment,
code varchar(250),
created_at TIMESTAMP default 0,
modified_at TIMESTAMP on update current_timestamp,
primary key(id)
) engine innodb;
Rails has some timestamping conventions/methods of its own, but i think this kind of intelligence should reside within the database, not in a web framework.
zondag 23 september 2007
Gentoo sucks
So im trying to get kissxd installed to be able to connect my pc to my buggy divx player.
It won't install because when i try do do a "emerge -pv --newuse world" it says it needs a newer version of app-text/poppler-bindings, which in turn has been masked....this should be easier, damnit!!
It won't install because when i try do do a "emerge -pv --newuse world" it says it needs a newer version of app-text/poppler-bindings, which in turn has been masked....this should be easier, damnit!!
Abonneren op:
Reacties (Atom)