Reputation: 2501
Here is the query I would like
SELECT * FROM information_schema.tables WHERE table_name = 'shop_ean_2016_06_12';
but "2016_06_12" in the query should be yesterday. I know "NOW() - '1 day'::INTERVAL" but I want to use it in the table name comparison.
Thank you for any way of doing this.
Upvotes: 2
Views: 48
Reputation: 1701
select * from information_schema.tables where table_name ='shop_ean_' || to_char(now() - interval '1 day','YYYY_MM_DD');
Upvotes: 1