I am using SQLite in an android application.
In all my tables, I have a default row with index 0, which contains the default values ββfor this table.
In most cases, the default number for each field is 0, and this is the best number to use.
However, when I sort my data using the ORDER BY statement, I want all my null-value fields to be placed at the end of the list, because they are usually empty and use the default information.
The exclusion of these fields in the where statement is unacceptable, as I am trying to sort the information, not filter it.
Here is what I still have:
select distinct item.name, epoch_date.epoch
from epoch_date, time
where (time.begin_date_id = epoch_date._id)
and (item.time_id = time._id)
order by epoch_date.epoch;
In my sandbox database, this returns something like:
"item 1", 0
"item 2", 0
"item 4", 0
.
.
.
"item 3", 1275350400
"item 42", 1275472800
"item 12", 1275472800
But I want:
"item 3", 1275350400
"item 42", 1275472800
"item 12", 1275476400
.
.
.
"item 1", 0
"item 2", 0
"item 4", 0