SAGA
科研費申請と実績報告書用データ(2024/08/26)†
- 報告書用データベース
kakenhi_R2
kakenhi_R4
二つのテーブルを比較して差分を表示(2018/09/20)†
- データの更新前後のテーブルを比較する場合に便利。
select * from saga_uptest.abundance b where not exists (select a.Entry, a.Object from saga_LG_uptest.abundance a where a.Entry = b.Entry and a.Object = b.Object ) order by Entry, Object;
- カタログの更新チェック
select * from saga_LG_uptest.object_catalog b where not exists (select a.Entry, a.Object from saga_LG.object_catalog a where a.Entry = b.Entry and a.Object = b.Object ) order by Entry, Object;
MySQLでテーブルの数をカウント(2017/11/21)†
- 一時テーブルのカウントに利用。
select count(*) from `information_schema`.`tables` where `table_schema` = 'suda_tmp';
- おまけ:テーブルのレコード数をカウント。
select table_name, table_rows from information_schema.TABLES
where table_schema = 'suda_tmp';
テーブル名変更†
データベースのコピー†
MySQLテーブルが作成された日時を取得。(2016/07/08)†
select table_schema, table_name, create_time from information_schema.tables where table_schema = 'suda_tmp' order by create_time;
MySQLテーブルが更新された日時を取得。(2024/05/06)†
select table_schema, table_name, update_time from information_schema.tables where table_schema = 'DB名' and table_name = 'テーブル名'\G
- table_schema = saga_LG_uptest, table_name = object_catlogではupdate_timeが登録されていないので注意。