Now, what happens if you want to sort or filter
or do other things?
So this is where you can do ORDER BY.
And I'm going to show you some examples here.
In the left, we are saying, OK, we
want to ORDER BY ZTIMESTAMP ascending.
We want to ORDER BY ZTIMESTAMP ascending.
And we can see message received, and then we
can see our timestamps.
So it's going to sort in ascending or descending.
So you can change asc to descending.
Something else that's interesting
is, if you change the column names, ZTIMESTAMP to Message
Received, you can put that in quotes,
and it will still filter by it, which is pretty awesome.
What happens if you had to say where
a message contained Heather or where
the date is like 1/1/2022.
You can do that.
So you say where, the column of interest, like, single tick
quote--
or single tick parenthese, the word or date,
parenthese single tick.
Now, I want to show you how to know
if your wild cards are wrong.
So let's say we want to search very similar to how I did oil.
So what we could do is say, where "warning" like--
now I'm going to do this wrong because I want to show you
what it looks like to be wrong.
Do you notice right away how it's black font/red font?
If I change it, single take parenthese, it's red/red.
That's what we want.
Oil-- and again, I'm going to mess it up.
The black and the red look weird--
Parenthese, single tick.
So you want to make sure the color of the wild card
makes sense.
And then you can see it just shows us those same things
I filtered for.
It's saying, hey, there's oil or roadkill,
reporting oil on the road.
I have no idea what this database is.
It's very strange, but it looks like it's
doing something associated with traffic reports.
If you wanted to clear this, you could do Clear it.
Bring everything back.
Maybe you want to filter by datetime.
So order by, "Update time" descending or ascending--
boom, sorts it by that.
You could also do-- if you wanted a specific date,
you could do where "update time" like parentheses single tick.
So many things you can do.
You can do count.
There are so many things you can do in SQLite, it's amazing.
If you mess up, or if you want to keep practicing--
you're, like, OK, that one worked,
but now I want to branch out.
Press this little button right here,
and it brings you a new one.
So you can always keep your old and go back.
You can keep it open.
What I do is, when I have success,
I will save this out to a text file.
And I would call this tts.db Android Version 12 and Copy
and Paste this in.
And I have a whole text repository of queries.
But this is just one example.
The more you practice, the better you will get.