我只想在使用条件时只订购第二条SELECT
语句。UNION ALL
我将查询写为:
db.rawQuery("SELECT _id, product_code, product_name, product_category,discount, in_stock, price, brand
FROM ProductDetails
WHERE _id || ' ' || product_name || product_code
LIKE ?
UNION ALL SELECT _id, product_code, product_name, product_category,discount, in_stock, price, brand
FROM ProductDetails WHERE _id || ' ' || product_name || product_code
NOT LIKE ? ORDER BY brand ", new String[] { "%" +searchValue+ "%","%" +searchValue+"});
上面的查询是对总 Union 语句进行排序。
谁能告诉我如何仅对第二条SELECT
语句进行排序?