/ *9. Write a SQL query to retrieve loan number, customer first name, customer last name,
property address, and bankruptcy attorney name. I want all the records that have the
same attorney name to be together, then the customer last name in order from Z-A
(ex.Customer last name of Wyatt comes before customer last name of Anderson)*/
Group BY BankruptcyAttorneyName,LoanNumber,CustomerFname,CustomerLname,Propertyaddress
LTrim(Reverse(Left(Reverse(CustomerLname), CharIndex(' ', Reverse(CustomerLname))))) Desc,
CustomerLname Desc -- Fall-over for when there isn't a last name
Is it right comment?