Menu

[OQL] How can I SELECT Manager of person

2015-02-20
2024-06-26
  • Khalil Charf

    Khalil Charf - 2015-02-20

    Hi

    How can I SELECT Manage from Person
    I try many request but all dosen't work.
    -> SELECT manager_name FROM Person AS p WHERE p.id= :current_contact_id (Error)
    -> SELECT PERSON as p JOIN Person a m ON m.id=p.manager_id WHERE p.id= :current_contact_id (Error)
    -> SELECT manager_id FROM Person AS p WHERE p.id= :current_contact_id (Error)

    Could you help me please.

    Khalil

     
  • Asparuh Vasilev

    Asparuh Vasilev - 2015-02-20

    SELECT Person AS p JOIN Person AS m ON m.manager_id=p.id WHERE m.id=:current_id

     
  • Khalil Charf

    Khalil Charf - 2015-02-20

    Thanks, That's save me

     
  • Vasek

    Vasek - 2019-11-22

    I would need this select, but for caller_id. Does exist this possibility please?

     
    • esi

      esi - 2019-11-22

      there is no caller_id within a person or contact.
      The caller_id is a foreign key from ticket class.

       
      • Vasek

        Vasek - 2019-11-22

        I know but what any JOIN or something? :-( I would need to send email notification to manager of caller when a ticket is in status "new".

         
        • Guillaume Lajarige

          You can try something like SELECT M FROM Person AS M JOIN Person AS C ON C.manager_id = M.id WHERE C.id = :this->caller_id

           
          • Vasek

            Vasek - 2019-11-22

            You're awesome! Thank you!

             
            👍
            1
            • Guillaume Lajarige

              Glad it helped! 😊

              Guillaume

               
  • Philippe AUGEY

    Philippe AUGEY - 2024-06-26

    Hi Guillaume,
    Is there a way to find the manager of the manager of a person (N+2) ?
    Many thanks for your help.
    Sorry, I'm new on this forum and I don't know if I can post a question on an existing discussion.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.