Most efficient way to get record from MAX(col2), grouped by col1SQL Server BCP insert additional columnsjoin two tables with different number of rows(in sql server)Query regarding database constraintscan I update all the columns in one setSQL inserting data from tabl1 to tabl2select rows with max value from groupjoining based on columns priorityHow to display ALL the Non-Null and ALL the Non-Empty records without mentioning ALL the column-name in the where clause using a MySql query?How to update the records from another tableCreating SQL views dynamically using Java

How should you gracefully leave a company you helped start?

How to train a replacement without them knowing?

Interaction between Leonin Warleader and Divine Visitation

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

Meaning and structure of headline "Hair it is: A List of ..."

What should I do with the stock I own if I anticipate there will be a recession?

Is a suspension needed to do wheelies?

Can I use images from my published papers in my thesis without copyright infringment?

Why is su world executable?

Units of measurement, especially length, when body parts vary in size among races

Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?

μονάδαι as plural form of μονάς

Expressing a chain of boolean ORs using ILP

Combinatorial Argument for Exponential and Logarithmic Function Being Inverse

Can anybody tell me who this Pokemon is?

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

What if a restaurant suddenly cannot accept credit cards, and the customer has no cash?

A+ rating still unsecure by Google Chrome's opinion

Short Story: Cold War setting. In orbit, two astronauts decide whether to launch nuclear counter strike ("MAD" scenario). Twist at end

Difference between "va faire" and "ira faire"

Why should I pay for an SSL certificate?

What is the fastest way to level past 95 in Diablo II?

What was the intention with the Commodore 128?

What's a good pattern to calculate a variable only when it is used the first time?



Most efficient way to get record from MAX(col2), grouped by col1


SQL Server BCP insert additional columnsjoin two tables with different number of rows(in sql server)Query regarding database constraintscan I update all the columns in one setSQL inserting data from tabl1 to tabl2select rows with max value from groupjoining based on columns priorityHow to display ALL the Non-Null and ALL the Non-Empty records without mentioning ALL the column-name in the where clause using a MySql query?How to update the records from another tableCreating SQL views dynamically using Java






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a table such as the below:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |1 |x |y |y |
|A |2 |x |x |y |
|B |1 |x |y |x |


What I want to do is return a single record for a non-unique value in col1, based on the maximum value in col2.



I could do this with a self inner join such as:



SELECT a.*
FROM table a INNER JOIN (
SELECT col1,
MAX(col2)
FROM table
GROUP BY col1) b
ON b.col1 = a.col1 AND b.col2 = a.col2


Which would return:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |2 |x |x |y |
|B |1 |x |y |x |


However, this seems inefficient. Is there a more efficient way to do this?










share|improve this question


























  • which database your using and what version?

    – saravanatn
    Mar 27 at 13:00











  • Oracle, as per the tag. Version is 11g.

    – WSC
    Mar 27 at 13:13











  • I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

    – Barbaros Özhan
    Mar 27 at 13:40












  • When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

    – WSC
    Mar 27 at 13:47











  • That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

    – Barbaros Özhan
    Mar 27 at 15:18


















0















I have a table such as the below:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |1 |x |y |y |
|A |2 |x |x |y |
|B |1 |x |y |x |


What I want to do is return a single record for a non-unique value in col1, based on the maximum value in col2.



I could do this with a self inner join such as:



SELECT a.*
FROM table a INNER JOIN (
SELECT col1,
MAX(col2)
FROM table
GROUP BY col1) b
ON b.col1 = a.col1 AND b.col2 = a.col2


Which would return:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |2 |x |x |y |
|B |1 |x |y |x |


However, this seems inefficient. Is there a more efficient way to do this?










share|improve this question


























  • which database your using and what version?

    – saravanatn
    Mar 27 at 13:00











  • Oracle, as per the tag. Version is 11g.

    – WSC
    Mar 27 at 13:13











  • I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

    – Barbaros Özhan
    Mar 27 at 13:40












  • When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

    – WSC
    Mar 27 at 13:47











  • That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

    – Barbaros Özhan
    Mar 27 at 15:18














0












0








0








I have a table such as the below:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |1 |x |y |y |
|A |2 |x |x |y |
|B |1 |x |y |x |


What I want to do is return a single record for a non-unique value in col1, based on the maximum value in col2.



I could do this with a self inner join such as:



SELECT a.*
FROM table a INNER JOIN (
SELECT col1,
MAX(col2)
FROM table
GROUP BY col1) b
ON b.col1 = a.col1 AND b.col2 = a.col2


Which would return:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |2 |x |x |y |
|B |1 |x |y |x |


However, this seems inefficient. Is there a more efficient way to do this?










share|improve this question
















I have a table such as the below:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |1 |x |y |y |
|A |2 |x |x |y |
|B |1 |x |y |x |


What I want to do is return a single record for a non-unique value in col1, based on the maximum value in col2.



I could do this with a self inner join such as:



SELECT a.*
FROM table a INNER JOIN (
SELECT col1,
MAX(col2)
FROM table
GROUP BY col1) b
ON b.col1 = a.col1 AND b.col2 = a.col2


Which would return:



|col1|col2|col3|col4|col5|
|----|----|----|----|----|
|A |2 |x |x |y |
|B |1 |x |y |x |


However, this seems inefficient. Is there a more efficient way to do this?







sql oracle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 29 at 6:21









Barbaros Özhan

20.5k7 gold badges16 silver badges36 bronze badges




20.5k7 gold badges16 silver badges36 bronze badges










asked Mar 27 at 12:49









WSCWSC

1412 silver badges12 bronze badges




1412 silver badges12 bronze badges















  • which database your using and what version?

    – saravanatn
    Mar 27 at 13:00











  • Oracle, as per the tag. Version is 11g.

    – WSC
    Mar 27 at 13:13











  • I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

    – Barbaros Özhan
    Mar 27 at 13:40












  • When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

    – WSC
    Mar 27 at 13:47











  • That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

    – Barbaros Özhan
    Mar 27 at 15:18


















  • which database your using and what version?

    – saravanatn
    Mar 27 at 13:00











  • Oracle, as per the tag. Version is 11g.

    – WSC
    Mar 27 at 13:13











  • I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

    – Barbaros Özhan
    Mar 27 at 13:40












  • When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

    – WSC
    Mar 27 at 13:47











  • That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

    – Barbaros Özhan
    Mar 27 at 15:18

















which database your using and what version?

– saravanatn
Mar 27 at 13:00





which database your using and what version?

– saravanatn
Mar 27 at 13:00













Oracle, as per the tag. Version is 11g.

– WSC
Mar 27 at 13:13





Oracle, as per the tag. Version is 11g.

– WSC
Mar 27 at 13:13













I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

– Barbaros Özhan
Mar 27 at 13:40






I couldn't understand why you removed the tag "sql". oracle stands for database, the spesific subject "sql" also needs to be added.

– Barbaros Özhan
Mar 27 at 13:40














When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

– WSC
Mar 27 at 13:47





When you create a question with both oracle and sql, StackOverflow guidance says to only use one or the other, not both: "SQL questions get better answers if they... Include a tag for one specific database engine (MySQL, Oracle, etc...) Show the SQL that isn't working Describe exactly how it isn't working (error message, unexpected results, etc...) Describe the desired results"

– WSC
Mar 27 at 13:47













That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

– Barbaros Özhan
Mar 27 at 15:18






That guidance tells not to leave sql tag alone, add a DBMS tag also, since, mostly sql statement may contain properties spesific to a DBMS, that you already added, but sql tag is missing.

– Barbaros Özhan
Mar 27 at 15:18













3 Answers
3






active

oldest

votes


















1














I think you can prefer using in operator with a more direct way



select *
from "table"
where (col1,col2) in ( select col1,max(col2)
from "table"
group by col1
)





share|improve this answer
































    1














    use correlated subquery



    select * from tablename a
    where col2 in (select max(col2) from tablename b where a.col1=b.col1)





    share|improve this answer
































      1














      You are using Oracle, do not need use correlated subquery or self-joins for this simple case. Just use analytic functions.



      with s (col1, col2, col3, col4, col5) as (
      select 'A', 1, 'x', 'y', 'y' from dual union all
      select 'A', 2, 'x', 'x', 'y' from dual union all
      select 'B', 1, 'x', 'y', 'x' from dual)
      select*
      from
      (select s.*, max(col2) over (partition by col1) mx
      from s
      )
      where col2 = mx;

      C COL2 C C C MX
      - ---------- - - - ----------
      A 2 x x y 2
      B 1 x y x 1

      Elapsed: 00:00:00.00

      with s (col1, col2, col3, col4, col5) as (
      select 'A', 1, 'x', 'y', 'y' from dual union all
      select 'A', 2, 'x', 'x', 'y' from dual union all
      select 'B', 1, 'x', 'y', 'x' from dual)
      select*
      from
      (select s.*, row_number() over (partition by col1 order by col2 desc) rn
      from s
      )
      where rn = 1;

      C COL2 C C C RN
      - ---------- - - - ----------
      A 2 x x y 1
      B 1 x y x 1

      Elapsed: 00:00:00.00

      with s (col1, col2, col3, col4, col5) as (
      select 'A', 1, 'x', 'y', 'y' from dual union all
      select 'A', 2, 'x', 'x', 'y' from dual union all
      select 'B', 1, 'x', 'y', 'x' from dual)
      select
      col1,
      max(col2) col2,
      max(col3) keep (dense_rank last order by col2) col3,
      max(col4) keep (dense_rank last order by col2) col4,
      max(col5) keep (dense_rank last order by col2) col5
      from s
      group by col1;

      C COL2 C C C
      - ---------- - - -
      A 2 x x y
      B 1 x y x

      Elapsed: 00:00:00.01





      share|improve this answer



























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377623%2fmost-efficient-way-to-get-record-from-maxcol2-grouped-by-col1%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        1














        I think you can prefer using in operator with a more direct way



        select *
        from "table"
        where (col1,col2) in ( select col1,max(col2)
        from "table"
        group by col1
        )





        share|improve this answer





























          1














          I think you can prefer using in operator with a more direct way



          select *
          from "table"
          where (col1,col2) in ( select col1,max(col2)
          from "table"
          group by col1
          )





          share|improve this answer



























            1












            1








            1







            I think you can prefer using in operator with a more direct way



            select *
            from "table"
            where (col1,col2) in ( select col1,max(col2)
            from "table"
            group by col1
            )





            share|improve this answer













            I think you can prefer using in operator with a more direct way



            select *
            from "table"
            where (col1,col2) in ( select col1,max(col2)
            from "table"
            group by col1
            )






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 27 at 12:56









            Barbaros ÖzhanBarbaros Özhan

            20.5k7 gold badges16 silver badges36 bronze badges




            20.5k7 gold badges16 silver badges36 bronze badges


























                1














                use correlated subquery



                select * from tablename a
                where col2 in (select max(col2) from tablename b where a.col1=b.col1)





                share|improve this answer





























                  1














                  use correlated subquery



                  select * from tablename a
                  where col2 in (select max(col2) from tablename b where a.col1=b.col1)





                  share|improve this answer



























                    1












                    1








                    1







                    use correlated subquery



                    select * from tablename a
                    where col2 in (select max(col2) from tablename b where a.col1=b.col1)





                    share|improve this answer













                    use correlated subquery



                    select * from tablename a
                    where col2 in (select max(col2) from tablename b where a.col1=b.col1)






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 27 at 13:15









                    fa06fa06

                    24.1k4 gold badges11 silver badges20 bronze badges




                    24.1k4 gold badges11 silver badges20 bronze badges
























                        1














                        You are using Oracle, do not need use correlated subquery or self-joins for this simple case. Just use analytic functions.



                        with s (col1, col2, col3, col4, col5) as (
                        select 'A', 1, 'x', 'y', 'y' from dual union all
                        select 'A', 2, 'x', 'x', 'y' from dual union all
                        select 'B', 1, 'x', 'y', 'x' from dual)
                        select*
                        from
                        (select s.*, max(col2) over (partition by col1) mx
                        from s
                        )
                        where col2 = mx;

                        C COL2 C C C MX
                        - ---------- - - - ----------
                        A 2 x x y 2
                        B 1 x y x 1

                        Elapsed: 00:00:00.00

                        with s (col1, col2, col3, col4, col5) as (
                        select 'A', 1, 'x', 'y', 'y' from dual union all
                        select 'A', 2, 'x', 'x', 'y' from dual union all
                        select 'B', 1, 'x', 'y', 'x' from dual)
                        select*
                        from
                        (select s.*, row_number() over (partition by col1 order by col2 desc) rn
                        from s
                        )
                        where rn = 1;

                        C COL2 C C C RN
                        - ---------- - - - ----------
                        A 2 x x y 1
                        B 1 x y x 1

                        Elapsed: 00:00:00.00

                        with s (col1, col2, col3, col4, col5) as (
                        select 'A', 1, 'x', 'y', 'y' from dual union all
                        select 'A', 2, 'x', 'x', 'y' from dual union all
                        select 'B', 1, 'x', 'y', 'x' from dual)
                        select
                        col1,
                        max(col2) col2,
                        max(col3) keep (dense_rank last order by col2) col3,
                        max(col4) keep (dense_rank last order by col2) col4,
                        max(col5) keep (dense_rank last order by col2) col5
                        from s
                        group by col1;

                        C COL2 C C C
                        - ---------- - - -
                        A 2 x x y
                        B 1 x y x

                        Elapsed: 00:00:00.01





                        share|improve this answer





























                          1














                          You are using Oracle, do not need use correlated subquery or self-joins for this simple case. Just use analytic functions.



                          with s (col1, col2, col3, col4, col5) as (
                          select 'A', 1, 'x', 'y', 'y' from dual union all
                          select 'A', 2, 'x', 'x', 'y' from dual union all
                          select 'B', 1, 'x', 'y', 'x' from dual)
                          select*
                          from
                          (select s.*, max(col2) over (partition by col1) mx
                          from s
                          )
                          where col2 = mx;

                          C COL2 C C C MX
                          - ---------- - - - ----------
                          A 2 x x y 2
                          B 1 x y x 1

                          Elapsed: 00:00:00.00

                          with s (col1, col2, col3, col4, col5) as (
                          select 'A', 1, 'x', 'y', 'y' from dual union all
                          select 'A', 2, 'x', 'x', 'y' from dual union all
                          select 'B', 1, 'x', 'y', 'x' from dual)
                          select*
                          from
                          (select s.*, row_number() over (partition by col1 order by col2 desc) rn
                          from s
                          )
                          where rn = 1;

                          C COL2 C C C RN
                          - ---------- - - - ----------
                          A 2 x x y 1
                          B 1 x y x 1

                          Elapsed: 00:00:00.00

                          with s (col1, col2, col3, col4, col5) as (
                          select 'A', 1, 'x', 'y', 'y' from dual union all
                          select 'A', 2, 'x', 'x', 'y' from dual union all
                          select 'B', 1, 'x', 'y', 'x' from dual)
                          select
                          col1,
                          max(col2) col2,
                          max(col3) keep (dense_rank last order by col2) col3,
                          max(col4) keep (dense_rank last order by col2) col4,
                          max(col5) keep (dense_rank last order by col2) col5
                          from s
                          group by col1;

                          C COL2 C C C
                          - ---------- - - -
                          A 2 x x y
                          B 1 x y x

                          Elapsed: 00:00:00.01





                          share|improve this answer



























                            1












                            1








                            1







                            You are using Oracle, do not need use correlated subquery or self-joins for this simple case. Just use analytic functions.



                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select*
                            from
                            (select s.*, max(col2) over (partition by col1) mx
                            from s
                            )
                            where col2 = mx;

                            C COL2 C C C MX
                            - ---------- - - - ----------
                            A 2 x x y 2
                            B 1 x y x 1

                            Elapsed: 00:00:00.00

                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select*
                            from
                            (select s.*, row_number() over (partition by col1 order by col2 desc) rn
                            from s
                            )
                            where rn = 1;

                            C COL2 C C C RN
                            - ---------- - - - ----------
                            A 2 x x y 1
                            B 1 x y x 1

                            Elapsed: 00:00:00.00

                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select
                            col1,
                            max(col2) col2,
                            max(col3) keep (dense_rank last order by col2) col3,
                            max(col4) keep (dense_rank last order by col2) col4,
                            max(col5) keep (dense_rank last order by col2) col5
                            from s
                            group by col1;

                            C COL2 C C C
                            - ---------- - - -
                            A 2 x x y
                            B 1 x y x

                            Elapsed: 00:00:00.01





                            share|improve this answer













                            You are using Oracle, do not need use correlated subquery or self-joins for this simple case. Just use analytic functions.



                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select*
                            from
                            (select s.*, max(col2) over (partition by col1) mx
                            from s
                            )
                            where col2 = mx;

                            C COL2 C C C MX
                            - ---------- - - - ----------
                            A 2 x x y 2
                            B 1 x y x 1

                            Elapsed: 00:00:00.00

                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select*
                            from
                            (select s.*, row_number() over (partition by col1 order by col2 desc) rn
                            from s
                            )
                            where rn = 1;

                            C COL2 C C C RN
                            - ---------- - - - ----------
                            A 2 x x y 1
                            B 1 x y x 1

                            Elapsed: 00:00:00.00

                            with s (col1, col2, col3, col4, col5) as (
                            select 'A', 1, 'x', 'y', 'y' from dual union all
                            select 'A', 2, 'x', 'x', 'y' from dual union all
                            select 'B', 1, 'x', 'y', 'x' from dual)
                            select
                            col1,
                            max(col2) col2,
                            max(col3) keep (dense_rank last order by col2) col3,
                            max(col4) keep (dense_rank last order by col2) col4,
                            max(col5) keep (dense_rank last order by col2) col5
                            from s
                            group by col1;

                            C COL2 C C C
                            - ---------- - - -
                            A 2 x x y
                            B 1 x y x

                            Elapsed: 00:00:00.01






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 27 at 13:17









                            akk0rd87akk0rd87

                            7116 bronze badges




                            7116 bronze badges






























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377623%2fmost-efficient-way-to-get-record-from-maxcol2-grouped-by-col1%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                                용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                                155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해