2 Replies Latest reply: Apr 28, 2014 11:38 AM by rp0428 RSS

    Doubt in PLSQL

    user13394828

      Hi guys!!

       

      I have been studying plsql and I need to solve an exercise but I have a doubt.

      I have a table and it has a column called "payment_total". I have to separated in three groups, for example:

      payment_total>= 5000 and <= 10000 is group 1.

      payment_total> 10000 and <= 20000 is group 2.

      payment_total> 20000 is group 3.

       

      I need to separate that groups using vararray or table??

        • 1. Re: Doubt in PLSQL
          Marwim

          Hello,

           

          this is the forum space for the tool SQL Developer (Not for general SQL/PLSQL questions)

          Your question should be asked in PL/SQL

           

          When you ask a question about SQL you will get the best answers when you post an example where we can test our answers before posting: create table and insert statements, expected output and what have you tried yourself.

          In this case you should also describe whether you want three different tables or a table with a status column for each interval or...

           

          Regards

          Marcus

          • 2. Re: Doubt in PLSQL
            rp0428
            I have been studying plsql and I need to solve an exercise but I have a doubt.

            I have a table and it has a column called "payment_total". I have to separated in three groups, for example:

            payment_total>= 5000 and <= 10000 is group 1.

            payment_total> 10000 and <= 20000 is group 2.

            payment_total> 20000 is group 3.

             

            I need to separate that groups using vararray or table??

            We have NO idea. It depends on how the 'groups' and data need to be used.

             

            1. You can just return ALL of the data as a query result but order the data based on those groups,

            2. You can put each group's data into a separate table

            3. You can update a 'group' column to indicate which group each row is in.,

             

            Without knowing the actual PROBLEM you are trying to solve and how the data needs to be used in the future there isn't any way to help you.