[odb-users] Query Result Problem
Erez Pics
picserez at gmail.com
Thu Sep 24 12:13:02 EDT 2015
Hi Boris,
Wow, you are right :-)
Thank you very very much, as always you have great advice for any question.
I am unsure how to make this an inner join instead of the default left
join, the ODB compiler does not approve the syntax I use, can you
please advice how to make the view to be an inner join ?
Thank you,
Erez.
On Thu, Sep 24, 2015 at 6:43 PM, Boris Kolpackov
<boris at codesynthesis.com> wrote:
> 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