SELECT n.*, t.* FROM agenda n, agendacategories t where n.cat_id=t.cat_id and n.day=23 and n.month=7 and n.year=2010