Sub-query returns single or multiple values. If you want to write a Subquery to return single value, then you need to include comparison operators. The list is <,>, =, >=<,<= and <>
Both numeric and strings you can compare. If you want to retrieve data from the RETAIL_PRICES table, when R_PRICE values equal to the maximum price listed in the S_PRICE column of the SALES_PRICES table, then below is the query.
For example, the subquery’s WHERE clause might include a condition that will return only one value.
The important point to remember is ensure your subquery returns single value.
Otherwise, you will receive an error when using a comparison operator.