Skip to content
Advertisement

How to create a sql view (CREATE VIEW) in sqlite(android) and query?

So I have a table and I want to create another table using “CREATE VIEW” from sql. I need to make a copy of the table that I am working with so I can use it 2x. My sql query would have to be like this:

my initial table is:

so anyone has any ideea where (in my code) I can create the view and how do I query it in android?

I can provide code if needed

Thank you 🙂

Advertisement

Answer

Based on this, you would create the view with the following statement:

You can create it right after you create the “base” table.

You can query it just like you would query any other table.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement