Skip to content

Nested self join and creating multiple sums

I have a basic parent / child scheme for expenditures: The underling data is the same so I just added a category column and parent_id. These have child records: I am trying to aggregate the totals …

group by order but found SELECT syntax

A select SQL with a subquery that contains a descending sort and inner join to link unto saem id (patid). Once this sort subquery is done I will make it a view query to be used by another SQL which is …

Iterate Through Each Record

I have an ASP.NET page which repeatedly calls a SQL stored procedure that pulls a random userID from the table Hearings_Users. What I need now is to pull each UserID in successive order. I would go …

sql join values from same table

i came up by visiting this question. so i made a query like this SELECT ru.iUserId,ru.iRefUserId,CONCAT(ru.vName,ru.vLastName) AS userName,CONCAT(iru.vName,iru.vLastName) AS RefUserName FROM `…