I&#039;m trying to create an Oracle function to be used in a report, but I&#039;m stuck on the SQL. I want to pass this function a job number and a run number. Each job can have multiple runs, and each run can have multiple lofos. I want to find the sum of the quantity for all the records with the same lofo within a run. <BR>I need an SQL statement like this:<BR><BR>Select sum(quan) from jps_run_detail where plate_change = 0 and<BR>stock_change = 0 and lofo is the same