%%[
var @i, @rows, @row, @productName, @prevProductName, @rowsToReturn
set @rowsToReturn = 0 /* up to 2000 */
set @rows = LookupOrderedRows("SubscriberProducts" ,@rowsToReturn, "ProductName asc", "EmailAddress",emailaddr)
set @prevProductName = ""
for @i = 1 TO RowCount(@rows) DO
set @row = Row(@rows,@i)
set @ProductName = Field(@row, "ProductName")
if empty(@prevProductName) or @productName != @prevProductName then
set @prevProductName = @productName
]%%
<h1>%%=v(@productName)=%%</h1>
%%[ endif ]%%
%%[ next @i ]%%