((scope.focusIsString() && (scope.getBrowseType() != ITEMS_BY_DATE_BROWSE)) || (scope .getBrowseType() == AUTHORS_BROWSE)) ? ""
((scope.focusIsString() && (scope.getBrowseType() != ITEMS_BY_DATE_BROWSE)) || (scope.getBrowseType() == AUTHORS_BROWSE) || (scope .getBrowseType() == SUBJECTS_BROWSE)) ? ""
    private static String createSqlInternal(BrowseScope scope,            String itemValue, boolean isCount)    {        String tablename = BrowseTables.getTable(scope);        String column = BrowseTables.getValueColumn(scope);        int browseType = scope.getBrowseType();        StringBuffer sqlb = new StringBuffer();        sqlb.append("select ");        sqlb.append(isCount ? "count(" : "");        sqlb.append(getTargetColumns(scope));        sqlb.append(isCount ? ")" : "");        /**         * This next bit adds another column to the query, so authors don't show         * up lower-case         */        if ((browseType == AUTHORS_BROWSE) && !isCount)        {            sqlb.append(",author");        }        sqlb.append(" from ");        sqlb.append(tablename);        // If the browse uses items (or item ids) instead of String values        // make a subquery.        // We use a separate query to make sure the subquery works correctly        // when item values are the same. (this is transactionally        // safe because we set the isolation level).        // If we're NOT searching from the start, add some clauses        boolean addedWhereClause = false;        if (scope.hasFocus())        {            String subquery = null;            if (scope.focusIsItem())            {                subquery = new StringBuffer().append(" or ( ").append(column)                        .append(" = ? and item_id {0}  ").append(                                scope.getFocusItemId()).append(")").toString();            }            if (log.isDebugEnabled())            {                log.debug("Subquery is \"" + subquery + "\"");            }            sqlb.append(" where ").append("(").append(column).append(" {1} ")                    .append("?").append(scope.focusIsItem() ? subquery : "")                    .append(")");            addedWhereClause = true;        }        String connector = addedWhereClause ? " and " : " where ";        sqlb.append(getScopeClause(scope, connector));        // For counting, skip the "order by" and "limit" clauses        if (isCount)        {            return sqlb.toString();        }        // Add an order by clause -- a parameter        sqlb                .append(" order by ")                .append(column)                .append("{2}")                .append(                        ((scope.focusIsString() && (scope.getBrowseType() != ITEMS_BY_DATE_BROWSE)) || (scope                                .getBrowseType() == AUTHORS_BROWSE)) ? ""                                : ", item_id{2}");        String myquery = sqlb.toString();        // A limit on the total returned (Postgres extension)        if (!scope.hasNoLimit())        {            if ("oracle".equals(ConfigurationManager.getProperty("db.name")))            {                myquery = "SELECT * FROM (" + myquery                        + ") WHERE ROWNUM <= {3} ";            }            else            {                // postgres uses LIMIT                myquery = myquery + " LIMIT {3} ";            }        }        return myquery;    }