QSqlQueryModel to display the result of several queries in one qtableview
-
I have three tables, table 1 connected to 2, and table 2 connected to 3 all tables has the same number of columns . so am using the QSqlQueryModel to display the results. is there a way to add a rows from different queries in one model and display it in one qtableview?
-
Does union work?
SELECT ... UNION ALL SELECT ... UNION ALL SELECT ...
-
@Shamma said in QSqlQueryModel to display the result of several queries in one qtableview:
unfortunately, no because the table are as a tree. each table related to just one.
What does this mean? A SQL table is not a tree, its a table.
The correct way to join data from several tables in SQL is what @Emon-Haque proposed. But you answer to him is completely unclear... -
Maybe a concrete example of what you want to achieve would be good here.
From your initial post I was thinking you needed QConcatenateTablesProxyModel but now I'm confused