[Runtime] Polish a Sqlite table selection statement.

The name 'registered_event' is not explictly declaired which table it
comes from in previous SQL statement.
This PR explictly clarifies column of which table is selected.
Merge pull request #1246 from shaochangbin/sql

[Runtime] Polish a Sqlite table selection statement.