Skip to content

Outsystems Advanced SQL

I will start by introducing my business logic. I have an entity called Machines. To each Machine I will assign up to 50 Options. On this query I used PIVOT so I can retrieve only one line per machine, with all the options (Columns) with value 0 or 1. Note: My Output structure is ready for 50 Options. SQL Quer…

SQL INNER JOIN of sum distinct values

I have 3 tables called musics, singers and playlistInfos. I want to get Top 10 listened England musics.What kind of sql query help me? SELECT * FROM musics m INNER JOIN playlistInfo p ON p.musicID = m.id INNER JOIN singer a ON a.id = m.singerID GROUP BY p.musicID ORDER BY p.listened I try this one but I did n…

How do I size and sapce

this is what i needed and i appreciate it guys Answer For problems like these, try to associate the output with its indices (or in this case, current_row). Also, it seems like it’s better to start from 0 for this one. max_row is 5, current_row is from 0 to 4. There are max_row – current_row &#8211…

SQL query to count how many values appear N times in a column

I have a table like this, but with 1mi rows: And I want to know how many TEAMS were visited N times. For instance, if I want to know how many TEAMS were visited once, the result would be 1 (because only team 2 was). If i wanted three times, result would be 2 (because both team 1 and 4