General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>select keyid, lname+fname customer, count(lname+fname), max(add_date) add_date ;
from newstates ;
group by 2 ;
into cursor crsTemp
>select a.lname+a.fname customer, a.keyid, a.add_date ;
from newstates a, crsTemp b ;
where a.lname+a.fname = b.customer and a.add_date = b.add_date ;
order by a.lname, a.fname ;
into cursor crsTemp2
>delete from newstates where keyid not in (select keyid from crsTemp2)
really appreciate the help. but just a little confused about what is keyid? in my case what i am calling the key is lname,fname, and the add_date is the tie breaker.
brenda
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only