kuroの覚え書き

96の個人的覚え書き

2017-09-18から1日間の記事一覧

phpのSQLクエリをSQLalchemyに移植

$query1 = "SELECT * FROM `$table_name1` left join ( select sum(case when `V_count` <= $value1 and `A`='x' then 1 when `V_count` <= $value1 and `A`='y' then 2 else 0 end) as count,`N`,`M` from `$table_name1` group by `N`, `M`) as tbls using…