# Query multiple applications

**URL:** <https://community.dynatrace.com/t/query-multiple-applications/36736>\
**Category:** Real User Monitoring\
**Tags:** usql\
**Created:** [September 30, 2022, 6:27pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736 "2022-09-30T18:27:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JGannon](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@JGannon](https://community.dynatrace.com/u/JGannon)\
**Post date:** [September 30, 2022, 6:27pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736/1 "2022-09-30T18:27:07Z")

</div>

Hi

I have 10+ applications where I want to get the screen widths. If I write the query for a single app the query works and I can get data for 365 days.

SELECT screenWidth as width, screenHeight as height, count(\*) as “Session count” from usersession where useraction.application = “applicationname” group by screenWidth, screenHeight ORDER BY count(\*) DESC

If I include ADD, (see below) the query fails as it tells me the data is limited to 51 and use TOP. Any idea as how I can get the data for all apps in a single query?

SELECT screenWidth as width, screenHeight as height, count(\*) as “Session count” from usersession where useraction.application = “app1” AND useraction.application = “app 2” group by screenWidth, screenHeight ORDER BY count(\*) DESC

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [September 30, 2022, 7:12pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736/2 "2022-09-30T19:12:31Z")

</div>

Can you confirm that you are seeing all data in frist query? It should be also limited to 51, based on tests I have done in my env.

Also, RUM data is stored for 35 days maximum, you will not get 365 days anyway.

---

<div class="post-metadata">

**Author:** ![JGannon](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@JGannon](https://community.dynatrace.com/u/JGannon)\
**Post date:** [September 30, 2022, 7:34pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736/3 "2022-09-30T19:34:56Z")

</div>

In the 1st query I get the data but it says “The default number of results aggregated from all&nbsp;screenHeight&nbsp;fields is limited to&nbsp;51. To modify this limit, use the&nbsp;**TOP()**&nbsp;function in&nbsp;\*\*SELECT.”

When I do the 2nd query I see no data at all.\*\*

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [September 30, 2022, 7:50pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736/4 "2022-09-30T19:50:16Z")

</div>

Oh I understood now.

Change the AND condition in Where to OR.

SELECT screenWidth as width, screenHeight as height, count(\*) as “Session count” from usersession where useraction.application = “app1” OR useraction.application = “app 2” group by screenWidth, screenHeight ORDER BY count(\*) DESC

When using AND, you are querying the sessions that shares both apps. Change to OR and you will get the data from both apps independently .

---

<div class="post-metadata">

**Author:** ![JGannon](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@JGannon](https://community.dynatrace.com/u/JGannon)\
**Post date:** [September 30, 2022, 8:10pm UTC](https://community.dynatrace.com/t/query-multiple-applications/36736/5 "2022-09-30T20:10:35Z")

</div>

Great..this works. Thanks much for the quick reply
