Home » SQL & PL/SQL » SQL & PL/SQL » Subquery
Subquery [message #614587] Fri, 23 May 2014 09:32 Go to next message
sudharshan
Messages: 48
Registered: November 2006
Member
SELECT rct.trx_number,
   gcc.gl_account_type
FROM RA_CUSTOMER_TRX_all rct,
  RA_CUST_TRX_LINE_GL_DIST_all rctlg,
  gl_code_combinations_kfv gcc,
  (SELECT fu.user_id
  FROM fnd_user fu,
    FND_USER_RESP_GROUPS_DIRECT fur,
    FND_RESPONSIBILITY_VL frv
  WHERE 1                   =1
  AND fu.user_id            = fur.user_id
  AND fur.responsibility_id = frv.responsibility_id
  AND responsibility_name  IN 'xxx'
  )a
WHERE 1                       =1
AND rct.trx_number            ='263712'
AND account_class             ='REC'
AND gcc.gl_account_type      != 'A'
AND rct.customer_trx_id       = rctlg.customer_trx_id
AND rctlg.code_combination_id = gcc.code_combination_id
AND rctlg.created_by = a.user_id


I want to display the username which resides in the fu.username .. how do I do it?

Thanks!!!

--Moderator update: added [code] tags. Please do so yourself in future.

[Updated on: Fri, 23 May 2014 09:35] by Moderator

Report message to a moderator

Re: Subquery [message #614588 is a reply to message #614587] Fri, 23 May 2014 09:39 Go to previous messageGo to next message
John Watson
Messages: 8928
Registered: January 2010
Location: Global Village
Senior Member
Include USER_NAME in your list of projected columns, in both the sub-query and the outer query.
Re: Subquery [message #614590 is a reply to message #614588] Fri, 23 May 2014 09:41 Go to previous messageGo to next message
sudharshan
Messages: 48
Registered: November 2006
Member
Thanks!!! It worked..
Re: Subquery [message #614591 is a reply to message #614587] Fri, 23 May 2014 09:42 Go to previous messageGo to next message
Solomon Yakobson
Messages: 3269
Registered: January 2010
Location: Connecticut, USA
Senior Member
So what prevents you from it? Just keep in mind subquery is aliased as A, so it will be a.username.

SY.
Re: Subquery [message #614593 is a reply to message #614591] Fri, 23 May 2014 09:55 Go to previous message
sudharshan
Messages: 48
Registered: November 2006
Member
Thanks!! I added in the subquery but not the main query !!!
Previous Topic: How to resolve mutation error in function?
Next Topic: Function that will create comma separated list
Goto Forum:
  


Current Time: Tue Apr 16 10:35:39 CDT 2024