def make_query(specific_table, offset):
    """
    Generate a query to retrieve data from database.

    :param specific_table: Name of table to retrieve data from.
    :param offset: Optional offset to start from.
    """
    query = 'select DISTINCT * from `{}`'.format(specific_table)
    if isinstance(offset, int):
        unlimited = "18446744073709551615"
        # workaround for MySQL requiring a limit when using offset
        query += " LIMIT {}, {};".format(str(offset), unlimited)
    return query