Tuning advisor is used to get recommendations for indexes. It doesn't offer suggestions on rewriting code.
You can either submit a single query to DTA, or take a trace (a representative workload of the system) and let DTA use that as the basis of it's analysis.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass