public static function select(
        $fields,
        $tableNames,
        $whereClause = '',
        $groupBy = '',
        $orderBy = '',
        $limit = ''
    ) {
        if ($tableNames === '') {
            throw new \InvalidArgumentException('The table names must not be empty.', 1331488261);
        }
        if ($fields === '') {
            throw new \InvalidArgumentException('$fields must not be empty.', 1331488270);
        }

        self::enableQueryLogging();
        $dbResult = self::getDatabaseConnection()->exec_SELECTquery(
            $fields,
            $tableNames,
            $whereClause,
            $groupBy,
            $orderBy,
            $limit
        );
        if (!$dbResult) {
            throw new \Tx_Oelib_Exception_Database();
        }

        return $dbResult;
    }