I'm building a query that joins multiple tables and I'm coming across results where the rows are identical except for a code field.
Ex:
CUSTA 100
CUSTA 101
can I place some type of MIN or RANK function on the code field (based on the customer number) to find the lowest value within the main select statement, or do I need to do a subquery that finds the min first before its joined into the main select?
Microsoft SQL Server 2008Microsoft SQL Server 2005