Hi James,
This query
with element as (
select
`_id`,
ElementTypeName,
ElementSubTypeName,
PlanId
FROM
`mongo.grounds`.`Elements`
where PlanId = '1623263140'
), element_effort as (
select
`_id`,
EffortTypeName
FROM
`mongo.grounds`.`Elements_Efforts`
)
select
*
from
element
join
element_effort on element.`_id` = element_effort.`_id`
didn't return any records either.
On Fri, Feb 4, 2022 at 10:12 AM Daniel Clark <[email protected]> wrote:
> After running this query
>
> select
> *
> from
> `mongo.grounds`.`Elements` element
> where element.PlanId = '1623263140';
>
> Nothing is returned. Please see the attached screenshot.
>
> [image: Screen Shot 2022-02-04 at 10.08.07 AM.png]
>
> On Fri, Feb 4, 2022 at 10:03 AM James Turton <[email protected]> wrote:
>
>> Do you get records from this query?
>>
>> select
>> *
>> from
>> `mongo.grounds`.`Elements` element
>> where element.PlanId = '1623263140';
>>
>> Incidentally, for the full query including the WHERE clause, the form
>> below is probably going to be a good deal faster than the ones we've
>> written so far. I reintroduced some backticks, just in case that was
>> causing any trouble.
>>
>> with element as (
>> select
>> `_id`,
>> ElementTypeName,
>> ElementSubTypeName,
>> PlanId
>> FROM
>> `mongo.grounds`.`Elements`
>> where PlanId = '1623263140'
>> ), element_effort as (
>> select
>> `_id`,
>> EffortTypeName
>> FROM
>> `mongo.grounds`.`Elements_Efforts`
>> )
>> select
>> *
>> from
>> element
>> join
>> element_effort on element.`_id` = element_effort.`_id`
>>
>> On 2022/02/03 17:05, Daniel Clark wrote:
>> > I tried again with this query:
>> >
>> > with element as (
>> > select
>> > _id,
>> > ElementTypeName,
>> > ElementSubTypeName,
>> > PlanId
>> > FROM
>> > `mongo.grounds`.`Elements`
>> > ), element_effort as (
>> > select
>> > _id,
>> > EffortTypeName
>> > FROM
>> > `mongo.grounds`.`Elements_Efforts`
>> > )
>> > select
>> > *
>> > from
>> > element
>> > join
>> > element_effort on element._id = element_effort._id
>> > where element.PlanId = '1623263140'
>> >
>> > The query completed successfully, but it did not return any rows. I've
>> > attached the log and the profile.
>>
>