It seems like you want two different queries. This is written in T-SQL for SQL Server, but could easily be adapted for SQLite or MySQL or whatever you're working with.
1) Show me the Customer groups ordered by most recent
select Location_id, Customer, Max(Time) as LatestMessageTime from #Table
group by Location_id, Customer order by LatestMessageTime desc
This would be similar to the first view of your text message application.
2) Show me the Messages in order given a Location_id and Customer
declare @Location int, @Customer varchar(900)
set @Location = 1
set @Customer = '999-999-9999'
select * from #Table where Location_id = @Location and Customer = @Customer
order by Time desc
If you just wanted the sample output, you don't need anything too complex:
select t.*, g.MostRecentTime from #Table t LEFT OUTER JOIN
(select Location_id, Customer, Max(Time) as MostRecentTime from #Table
group by Location_id, Customer) g on g.Location_id = t.Location_id and g.Customer = t.Customer
order by MostRecentTime desc, Location_id, Customer, Time
Here's a SQLFiddle of it: http://sqlfiddle.com/#!6/ae3f8/1/0
I think this is an acceptable way to store the information. As far as retrieving it I'd have two different stored procedures: Give me the 'summary' (1 above), and then give me the 'messages' given a certain location and customer (2 above). I'd also order by .... Customer, Time desc
so that the most recent messages are the first returned, and then it goes 'back' into the past rather than loading the oldest first.