Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax

Status
Not open for further replies.

NotSQL

Technical User
May 17, 2005
205
GB
Hi Guys,I've been given a task to rewirte a bit of SQL and was wondering if you could help me out. The bit of sql below takesa while to run so any help would be greatful.

select NET_AMOUNT,UNIT_AMOUNT,QUANTITY,to_Char(PRO_ID) as ProID,to_Char(PER_ID) as PerID,to_Char(MEM_ID) as MEM_ID

from INVOICE_LINES

where exists(select 1 from calendar_periods cap where cap.id = cap_id and year_number > = to_number(to_char(sysdate,'YYYY')) - 2)
 
This is probably the wrong section for your question. But since you're here... can you provide the table structures, sample data from each table, and the results you'd expect from that sample data?

-----------------------------------------
I cannot be bought. Find leasing information at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top