SELECT d1.date, d1.agent_fee, SUM(d2.agent_fee) AS total_agent_fee For example, let’s say that after every completed deal, we want to know the total agent fee received so far. Computing Running TotalsĪ non-equi JOIN can be used to compute a running total of a particular column. In addition to the common applications of non-equi JOINs mentioned above, there are some more advanced scenarios for applying these kinds of JOINs. Get more practice with these types of SQL non-equi JOINs in our comprehensive course on SQL JOINs.Īdvanced Scenarios for Using Non-Equi JOINs Then, in the WHERE statement, we used a subquery to filter only the houses that are presumably free, i.e., not yet in our deals table.Īnd here is the list of houses that we can suggest to our customers (note that the house with ID 3 is just a duplicate of the house that this customer is renting now): id
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |