0

I have a list of databases I want to drop under a certain condition. I know GridDB SQL is not like Python where you can write commands under a condition block. But I would like to know if I can delete databases that have been updated only in the last two years. Suppose I have 32 databases, or more, I want to delete the old databases with an SQL command similar to the one below, if possible:

// Condition
 DROP DATABASE database;

or using Pandas, in Python:

sql_statement = ('DROP DATABASE database')
df = pd.read_sql_query(sql_statement, cont)

Maybe database is from a generator or something. How can I go about that? I am using GridDB Python client on my Ubuntu machine. Thanks in advance for your help!

  • 1
    I don't know GridDB but if you have some column to keep date when data was added/created/updated then first you would have to check it with normal `SELECT ... ORDER BY ...`. – furas Oct 11 '22 at 11:10
  • as I know SQL allows only one condition - `IF EXISTS` – furas Oct 11 '22 at 11:12

0 Answers0