[odb-users] Nested Select Query

علی دانش adanesh at noornet.net
Mon May 30 05:56:52 EDT 2016


Hi Boris!

Does ODB support nested select query?
For example:
SELECT name FROM world WHERE population > (SELECT population FROM world WHERE name='Romania')

In my case ​ the nested select is a view like this:

#pragma db view object(FacetIndexDocument) object(FacetIndexFieldValue) query((?) + "GROUP BY" + FacetIndexDocument::m_fieldName + "," + FacetIndexDocument::m_fieldValue)
   struct FacetIndexFieldValueCountView
   {
      int m_fieldName; //odb::lazy_shared_ptr<FacetIndexFieldName> m_fieldName;
      QString m_value;
#pragma db column("count(" + FacetIndexDocument::m_fieldValue + ")")
      int m_count;
   };

In fact I want to execute another query based on the results of this view.
Do you have any suggestions?

Thanks,
Ali



More information about the odb-users mailing list