android - Comparing two tables in Sqlite using common column -


i'm creating app automatically lists calls , sms of day in order of time. completed codes store both sms , calls database using services. have 2 table:

table call(number, name, call_type, call_duration, date, time, time_in_milliseconds (long))  table sms(number, name, message, date, time, time_in_milliseconds (long))  

i need compare both tables based on time_in_milliseconds, , retrieves entire row , set text view in order of time_in_milliseconds increases.

if understand correctly can use code:

        ourdatabase.rawquery("select number, name, call_type, call_duration, date, time, time_in_milliseconds " +             " call " +             " union " +             " select number, name, message, date, time, time_in_milliseconds " +             " sms " +             " order time_in_milliseconds", null); 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -