How can I make it so 2 Where conditions can be dependent For Example, a condition that has to go through a set of condition, and then find the value set on a condition within the condition prior
Here's the full syntax
SELECT
RIGHT(s.Staff_ID, 3) AS [Staff Number],
Staff_FullName,
[Sales Transaction Date] = CONVERT(VARCHAR(30), SalesDate, 107),
[Total Quantity] = SUM(Quantity)
FROM
STAFF s
JOIN
SalesTransaction st
ON s.Staff_ID = st.Staff_ID
WHERE
Staff_Country = 'China' AND
len(Staff_FullName) = (SELECT max(len(Staff_FullName)) FROM STAFF)
GROUP BY
s.Staff_ID,
Staff_FullName,
SalesDate
ORDER BY SUM (Quantity) ASC ```
How can I make it so it checks the longest value within the USA column?
Thank you in advance.