Simple query sum I need help please

I need an application to do something like this:

Select customer_site_use_id
of ar_payment_schedules_all ps
where ps.status = "OP".
AND NVL (ps.receipt_confirmed_flag, 'Y') = 'Y '.
and exists (select (sum (ps1.acctd_amount_due_remaining) as amtdue)
of ar_payment_schedules_all ps1
where ps1.customer_site_use_id = ps.customer_site_use_id
and (amtdue < 0)
and ps.customer_site_use_id = 1593

I can do this too difficult. I don't know if I need it is clause and the second select statement. In it are statement, if the sum of all the acctd_amount_due_remaining in ar_payment_schedules_all for the same customer_site_use_id is less than 0, then it is in the results.

Hello

user13444294 wrote:
Hello

I'm just starting to post on the site. I see what you mean on the information that I need to add. I think that what you gave me but is close, the only question I have is it would start really with statement "? I have never seen it before.

Yes, the request begins with the keyword WITH. Try it.

Tags: Database

Similar Questions

Maybe you are looking for

  • Simple Question - thinking of buying the new video card - HPE Pavillion H8 1020-

    I think to buy an AMD Radeon R7 x 260, is my PC (HPE Pavillion H8-1020) compatible with this card? I'll be able to simply switch to him?

  • H8-1234 BIOS Setup affecting "f"?

    What function key allows me to implement or change the BIOS on a h8-1234? I found the following functions (Hdwr diagnoses) f2, f8 (the Boot Mode selection) and f12 (boot Source), but nothing about the configuration of the BIOS. Thank you

  • fundamental question of write and read.vi series

    I downloaded the basic_serial_write_and_read.vi so that I can learn how to make my VI communicate through series.  Why the example diagram shows the resource name VISA, baud rate, parity, etc. as small rectangles, but when I go to create my own vi an

  • Is it possible to disable the intelligence of Hyper-V?

    Hello world! I have a question according to the intelligence used by a Windows guest OS running under Hyper-V on Windows 2012. Is it possible to manage the intelligence used by the prompt? For example, is it possible to transform support for a kind o

  • The faulty or incorrect error for D6160 message print cartridge

    The message said: I have some incorrect cartridge somehow. The cartridge is a good HP363 one and me the printer is off, found another adequate cartridge, reinstalled the driver... does anyone know what I can do? I'm not very brave to take the thing a