134
Views
3
Comments
Solved
Cross Join, SQL Widget
Question
Application Type
Reactive

Hi All,

Can we perform cross join using SQL widget (or using any way) in OutSystems?

Just curious to know as a beginner. If yes, please help with an example.

Thanks

2023-03-16 16-29-51
Paulo Rosário
Solution

Hello Dipali, 

You can use the Cross Join inside an Advance SQL Querry widget.

You will need however a valid structure to use in that Advanced SQL Querry.

In my testing I created these 2 tables :

and 

And then I created my Querry 

Result : 

Hope it helps!

Paulo Rosário

2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

Hello Dipali,

Hope you're doing well.

That is indeed possible to perform in OutSystems, using an Aggregate.

You can check this documentation.

The last example (combine all records, ignore relationship) is what you pretend, meaning, a cross join :)


Basically, you just need to add 2 entities into your Aggregate without any join relation between them. You'll instantly have a warning in Service Studio for those entities saying that the cross join is being calculated. As an example:



Hope that this helps you!


Kind regards,

Rui Barradas

2024-01-09 08-05-30
Dipali Shrawane
Solution

Hi,

Thank you Rui Barradas and Paulo Rosario.

2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

Hello Dipali,

Hope you're doing well.

That is indeed possible to perform in OutSystems, using an Aggregate.

You can check this documentation.

The last example (combine all records, ignore relationship) is what you pretend, meaning, a cross join :)


Basically, you just need to add 2 entities into your Aggregate without any join relation between them. You'll instantly have a warning in Service Studio for those entities saying that the cross join is being calculated. As an example:



Hope that this helps you!


Kind regards,

Rui Barradas

2023-03-16 16-29-51
Paulo Rosário
Solution

Hello Dipali, 

You can use the Cross Join inside an Advance SQL Querry widget.

You will need however a valid structure to use in that Advanced SQL Querry.

In my testing I created these 2 tables :

and 

And then I created my Querry 

Result : 

Hope it helps!

Paulo Rosário

2024-01-09 08-05-30
Dipali Shrawane
Solution

Hi,

Thank you Rui Barradas and Paulo Rosario.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.