query QtSql QSqlQuery SELECT id name FROM artists WHERE name LIKE sear

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
query = QtSql.QSqlQuery("""SELECT id, name FROM artists
WHERE name LIKE :search1
OR (SELECT COUNT(title) FROM albums
WHERE title LIKE :search2) > 0
OR
(SELECT COUNT(title) FROM tracks
WHERE album in (SELECT id
FROM albums
WHERE
title LIKE :search3)
AND title LIKE :search4) > 0
GROUP BY name""")