Left outer join with Select clause in Android

I am trying to run this query in my SQLite database:

SELECT * FROM tag LEFT OUTER JOIN (SELECT tag, annotation FROM annotation_tag_map WHERE annotation = ?) AS map ON tag._id = map.tag; 

What? is an annotation identifier.

I get an empty cursor when I run this request in android.

However, when I run it with sqlite3 from the command line in the same database, I get the results that I want.

+4
source share
1 answer

Check your query at runtime and type rsults?

if yes, then

 Cursor cursor = database.rawQuery(Your Query as a String,null); 
+2
source

Source: https://habr.com/ru/post/1412853/


All Articles