<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_last_sequence(self, cur=None):
 """ Get the highest sequence number in this db """

        sql = 'SELECT sequence FROM {} ORDER BY sequence DESC LIMIT 1;'.format(self.subdomain_table)
        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        db_query_execute(cursor, sql, ())
        last_seq = None
        try:
            last_seq = cursor.fetchone()[0]
        except:
            last_seq = 0
        
        return int(last_seq)