[odb-users] Query Result Problem

Boris Kolpackov boris at codesynthesis.com
Thu Sep 24 11:43:44 EDT 2015


Hi Erez,

Erez Pics <picserez at gmail.com> writes:

> SELECT person_lang_data.data_language,COUNT(DISTINCT person_set.person_id)
> FROM person_lang_data JOIN person_set ON person_lang_data.person_set_id =
> person_set.person_set_id GROUP BY data_language;
> 
> #pragma db view object(CPersonSet) \
> 	object(CPersonLangData: CPersonSet::m_person_set_id == CPersonLangData::m_person_set_id) \
> 	query((?) + "GROUP BY" + CPersonLangData::m_data_language)

One thing I noticed is that in the SELECT statement you JOIN person_set
on person_lang_data while in the view, you join CPersonLangData on
CPersonSet. Could this be the reason for the different results?

Also, I suggest that you enable statement tracing and check the actual
statement that is being executed for this view.

Boris



More information about the odb-users mailing list