Skip to content

Find rows where sum of columns from multiple rows is greater than X

The best way to explain this question is through the real life example it would solve. I have two tables, Match Overview and Match Attributes Match overview looks like While match attributes looks like Where match_id is a foreign key for id in the match overview table, and attribute id is the integer represen…

Casting Decimal to Currency in AWS Athena

I have a field value(decimal(23, 2)) and I am querying over it like this: sum(value) and as output i get 1200000.32 I am trying to cast it to currency to get $1.200.000,32 like this: How can I get the desired currency type? Answer There is no money type in presto. And Amazon’s version of presto does not…

Saving with SQL

Hi all I have a page that I’m trying to ADD to a list and save it with viewmodel and SQL. but my list is empty Can you tell me where am I wrong?? on my Xaml (Page1): my Model (Energypage): And on my EnergyViewModel: I did bond my page1 to Energyviewmodel, and it works find when I didn’t use

Create a new column for a table with select data from another table

I have a SQL table that shows the date and time information of a topic. FirstTable looks like this: id DateP TimeP 1 1397/01/02 01:30 2 1398/05/09 05:30 3 1398/06/07 05:10 4 1398/08/09 06:12 5 1399/02/01 07:15 I want to create columns for another table that are the result of selecting the DateP column and the…

TSQL – join two tables with TotalCounter and Pagination

I’m trying to join 2 tables (one to many relation) that include all the columns from first table and only the number of rows from the second one. Use case: one Service has many Reviews. The query looks like: The error is I need to include either average or group by clause but how would that look like I …

how to get start date of latest dept in which working

I’m trying to get the record of emp current working dept with start date Data, in below data Grp column is I’ve derived to get the 3rd last record, which is the correct result. query tried so far Am not able to think ahead, that how can I use Grp now to get 3rd last record as a output. Data