Mysql count id that appear in 2 columns










4















I have a table with these columns:



  • id

  • user_id

  • player_in

  • player_out

  • date

I need to make a report that count the number of repetitions each "player" both in player_in field, as in player_out field.
For example, if I have this 2 rows in the table (in the respective order).



id user_id player_in player_out
1 1 88 56
2 7 77 88


The result for the player 88 will be 2, and for the players 56 and 77, just 1










share|improve this question
























  • +1 I would like to know that too.

    – ncm
    Jul 7 '13 at 14:47






  • 1





    Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

    – David Starkey
    Jul 7 '13 at 14:47












  • +1. nice way.I think you are so smart.

    – ncm
    Jul 7 '13 at 14:49











  • MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

    – mauriblint
    Jul 7 '13 at 14:54















4















I have a table with these columns:



  • id

  • user_id

  • player_in

  • player_out

  • date

I need to make a report that count the number of repetitions each "player" both in player_in field, as in player_out field.
For example, if I have this 2 rows in the table (in the respective order).



id user_id player_in player_out
1 1 88 56
2 7 77 88


The result for the player 88 will be 2, and for the players 56 and 77, just 1










share|improve this question
























  • +1 I would like to know that too.

    – ncm
    Jul 7 '13 at 14:47






  • 1





    Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

    – David Starkey
    Jul 7 '13 at 14:47












  • +1. nice way.I think you are so smart.

    – ncm
    Jul 7 '13 at 14:49











  • MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

    – mauriblint
    Jul 7 '13 at 14:54













4












4








4








I have a table with these columns:



  • id

  • user_id

  • player_in

  • player_out

  • date

I need to make a report that count the number of repetitions each "player" both in player_in field, as in player_out field.
For example, if I have this 2 rows in the table (in the respective order).



id user_id player_in player_out
1 1 88 56
2 7 77 88


The result for the player 88 will be 2, and for the players 56 and 77, just 1










share|improve this question
















I have a table with these columns:



  • id

  • user_id

  • player_in

  • player_out

  • date

I need to make a report that count the number of repetitions each "player" both in player_in field, as in player_out field.
For example, if I have this 2 rows in the table (in the respective order).



id user_id player_in player_out
1 1 88 56
2 7 77 88


The result for the player 88 will be 2, and for the players 56 and 77, just 1







mysql sql count






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 5:52









Cœur

19k9112154




19k9112154










asked Jul 7 '13 at 14:43









mauriblintmauriblint

74521233




74521233












  • +1 I would like to know that too.

    – ncm
    Jul 7 '13 at 14:47






  • 1





    Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

    – David Starkey
    Jul 7 '13 at 14:47












  • +1. nice way.I think you are so smart.

    – ncm
    Jul 7 '13 at 14:49











  • MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

    – mauriblint
    Jul 7 '13 at 14:54

















  • +1 I would like to know that too.

    – ncm
    Jul 7 '13 at 14:47






  • 1





    Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

    – David Starkey
    Jul 7 '13 at 14:47












  • +1. nice way.I think you are so smart.

    – ncm
    Jul 7 '13 at 14:49











  • MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

    – mauriblint
    Jul 7 '13 at 14:54
















+1 I would like to know that too.

– ncm
Jul 7 '13 at 14:47





+1 I would like to know that too.

– ncm
Jul 7 '13 at 14:47




1




1





Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

– David Starkey
Jul 7 '13 at 14:47






Would SELECT COUNT(player_in), (SELECT COUNT(player_out) FROM myTable GROUP BY player_out) AS player_out FROM myTable GROUP BY player_in work?

– David Starkey
Jul 7 '13 at 14:47














+1. nice way.I think you are so smart.

– ncm
Jul 7 '13 at 14:49





+1. nice way.I think you are so smart.

– ncm
Jul 7 '13 at 14:49













MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

– mauriblint
Jul 7 '13 at 14:54





MySQL throw this error: #1242 - Subquery returns more than 1 row. Why?

– mauriblint
Jul 7 '13 at 14:54












2 Answers
2






active

oldest

votes


















3














Use a subquery that employs union all to get the two column into one column, then use a standard count(*):



Note: Thus query included individual totals for ins and outs as per further request in comments to this answer.



select
player_id,
count(*) as total,
sum(ins) as ins,
sum(outs) as outs
from (
select
player_in as player_id,
1 as ins,
0 as outs
from mytable
union all
select player_out, 0, 1
from mytable
) x
group by player_id


Note: you must use union all (not just union), because union removes duplicates whereas union all does not.






share|improve this answer

























  • This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

    – mauriblint
    Jul 7 '13 at 14:57












  • You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

    – Bohemian
    Jul 7 '13 at 15:04











  • Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

    – mauriblint
    Jul 7 '13 at 15:45











  • That's actually a different question, but see answer for bonus edits to see how.

    – Bohemian
    Jul 7 '13 at 20:39






  • 1





    Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

    – Bohemian
    Jul 7 '13 at 23:08


















2














You could use a cross-join to a 2-row virtual table to unpivot the player_* columns, then group the results, like this:



SELECT
player,
COUNT(*) AS total_count
FROM (
SELECT
CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
FROM mytable t
CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
) s
GROUP BY
player
;


That is, every row of the original table is essentially duplicated and each copy of the row supplies either player_in or player_out, depending on whether the derived table's is_in column is TRUE or FALSE, to form a single player column. This method of unpivoting might perform better than the UNION method suggested by @Bohemian because this way the (physical) table is passed just once (but you'd need to test and compare both methods to determine if there's any substantial benefit to this approach in your particular situation).



To calculate in and out counts, as you have requested in one of your comments to the above mentioned answer, you could extend my original suggestion like this:



SELECT
player,
COUNT( is_in OR NULL) AS in_count,
COUNT(NOT is_in OR NULL) AS out_count,

COUNT(*) AS total_count
FROM (
SELECT
x.is_in,
CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
FROM mytable t
CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
) s
GROUP BY
player
;


As you can see, the derived table now additionally returns the is_in column in its own right, and the column is used in two conditional aggregations for counting how many times a player was in and out. (If you are interested, the OR NULL trick is explained here.)



You could also rewrite the COUNT(condition OR NULL) entries as SUM(condition). That would certainly shorten both expressions, some also find the SUM method of counting clearer/more elegant. In either event, there would likely be no difference in performance, so choose whichever method suits your taste better.



A SQL Fiddle demo of the second query can be found here.






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%2f17513129%2fmysql-count-id-that-appear-in-2-columns%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Use a subquery that employs union all to get the two column into one column, then use a standard count(*):



    Note: Thus query included individual totals for ins and outs as per further request in comments to this answer.



    select
    player_id,
    count(*) as total,
    sum(ins) as ins,
    sum(outs) as outs
    from (
    select
    player_in as player_id,
    1 as ins,
    0 as outs
    from mytable
    union all
    select player_out, 0, 1
    from mytable
    ) x
    group by player_id


    Note: you must use union all (not just union), because union removes duplicates whereas union all does not.






    share|improve this answer

























    • This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

      – mauriblint
      Jul 7 '13 at 14:57












    • You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

      – Bohemian
      Jul 7 '13 at 15:04











    • Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

      – mauriblint
      Jul 7 '13 at 15:45











    • That's actually a different question, but see answer for bonus edits to see how.

      – Bohemian
      Jul 7 '13 at 20:39






    • 1





      Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

      – Bohemian
      Jul 7 '13 at 23:08















    3














    Use a subquery that employs union all to get the two column into one column, then use a standard count(*):



    Note: Thus query included individual totals for ins and outs as per further request in comments to this answer.



    select
    player_id,
    count(*) as total,
    sum(ins) as ins,
    sum(outs) as outs
    from (
    select
    player_in as player_id,
    1 as ins,
    0 as outs
    from mytable
    union all
    select player_out, 0, 1
    from mytable
    ) x
    group by player_id


    Note: you must use union all (not just union), because union removes duplicates whereas union all does not.






    share|improve this answer

























    • This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

      – mauriblint
      Jul 7 '13 at 14:57












    • You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

      – Bohemian
      Jul 7 '13 at 15:04











    • Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

      – mauriblint
      Jul 7 '13 at 15:45











    • That's actually a different question, but see answer for bonus edits to see how.

      – Bohemian
      Jul 7 '13 at 20:39






    • 1





      Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

      – Bohemian
      Jul 7 '13 at 23:08













    3












    3








    3







    Use a subquery that employs union all to get the two column into one column, then use a standard count(*):



    Note: Thus query included individual totals for ins and outs as per further request in comments to this answer.



    select
    player_id,
    count(*) as total,
    sum(ins) as ins,
    sum(outs) as outs
    from (
    select
    player_in as player_id,
    1 as ins,
    0 as outs
    from mytable
    union all
    select player_out, 0, 1
    from mytable
    ) x
    group by player_id


    Note: you must use union all (not just union), because union removes duplicates whereas union all does not.






    share|improve this answer















    Use a subquery that employs union all to get the two column into one column, then use a standard count(*):



    Note: Thus query included individual totals for ins and outs as per further request in comments to this answer.



    select
    player_id,
    count(*) as total,
    sum(ins) as ins,
    sum(outs) as outs
    from (
    select
    player_in as player_id,
    1 as ins,
    0 as outs
    from mytable
    union all
    select player_out, 0, 1
    from mytable
    ) x
    group by player_id


    Note: you must use union all (not just union), because union removes duplicates whereas union all does not.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 7 '13 at 23:07

























    answered Jul 7 '13 at 14:48









    BohemianBohemian

    299k65428566




    299k65428566












    • This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

      – mauriblint
      Jul 7 '13 at 14:57












    • You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

      – Bohemian
      Jul 7 '13 at 15:04











    • Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

      – mauriblint
      Jul 7 '13 at 15:45











    • That's actually a different question, but see answer for bonus edits to see how.

      – Bohemian
      Jul 7 '13 at 20:39






    • 1





      Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

      – Bohemian
      Jul 7 '13 at 23:08

















    • This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

      – mauriblint
      Jul 7 '13 at 14:57












    • You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

      – Bohemian
      Jul 7 '13 at 15:04











    • Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

      – mauriblint
      Jul 7 '13 at 15:45











    • That's actually a different question, but see answer for bonus edits to see how.

      – Bohemian
      Jul 7 '13 at 20:39






    • 1





      Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

      – Bohemian
      Jul 7 '13 at 23:08
















    This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

    – mauriblint
    Jul 7 '13 at 14:57






    This works fine i think, I have a table with multiple rows and I cant count one by one to check this, but i think this work fine. Is there any way to optimize the query?

    – mauriblint
    Jul 7 '13 at 14:57














    You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

    – Bohemian
    Jul 7 '13 at 15:04





    You could put separate indexes on player_in and player_out. Other than that, the query's about as simple as it gets - should perform fine.

    – Bohemian
    Jul 7 '13 at 15:04













    Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

    – mauriblint
    Jul 7 '13 at 15:45





    Ok! one more question, how can i get the 3 items, "ins" "outs" and "total" for each player? Thanks a lot.

    – mauriblint
    Jul 7 '13 at 15:45













    That's actually a different question, but see answer for bonus edits to see how.

    – Bohemian
    Jul 7 '13 at 20:39





    That's actually a different question, but see answer for bonus edits to see how.

    – Bohemian
    Jul 7 '13 at 20:39




    1




    1





    Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

    – Bohemian
    Jul 7 '13 at 23:08





    Added comma. (I typed this in on my iPhone... It can be harder to spot mistakes like that)

    – Bohemian
    Jul 7 '13 at 23:08













    2














    You could use a cross-join to a 2-row virtual table to unpivot the player_* columns, then group the results, like this:



    SELECT
    player,
    COUNT(*) AS total_count
    FROM (
    SELECT
    CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
    FROM mytable t
    CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
    ) s
    GROUP BY
    player
    ;


    That is, every row of the original table is essentially duplicated and each copy of the row supplies either player_in or player_out, depending on whether the derived table's is_in column is TRUE or FALSE, to form a single player column. This method of unpivoting might perform better than the UNION method suggested by @Bohemian because this way the (physical) table is passed just once (but you'd need to test and compare both methods to determine if there's any substantial benefit to this approach in your particular situation).



    To calculate in and out counts, as you have requested in one of your comments to the above mentioned answer, you could extend my original suggestion like this:



    SELECT
    player,
    COUNT( is_in OR NULL) AS in_count,
    COUNT(NOT is_in OR NULL) AS out_count,

    COUNT(*) AS total_count
    FROM (
    SELECT
    x.is_in,
    CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
    FROM mytable t
    CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
    ) s
    GROUP BY
    player
    ;


    As you can see, the derived table now additionally returns the is_in column in its own right, and the column is used in two conditional aggregations for counting how many times a player was in and out. (If you are interested, the OR NULL trick is explained here.)



    You could also rewrite the COUNT(condition OR NULL) entries as SUM(condition). That would certainly shorten both expressions, some also find the SUM method of counting clearer/more elegant. In either event, there would likely be no difference in performance, so choose whichever method suits your taste better.



    A SQL Fiddle demo of the second query can be found here.






    share|improve this answer





























      2














      You could use a cross-join to a 2-row virtual table to unpivot the player_* columns, then group the results, like this:



      SELECT
      player,
      COUNT(*) AS total_count
      FROM (
      SELECT
      CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
      FROM mytable t
      CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
      ) s
      GROUP BY
      player
      ;


      That is, every row of the original table is essentially duplicated and each copy of the row supplies either player_in or player_out, depending on whether the derived table's is_in column is TRUE or FALSE, to form a single player column. This method of unpivoting might perform better than the UNION method suggested by @Bohemian because this way the (physical) table is passed just once (but you'd need to test and compare both methods to determine if there's any substantial benefit to this approach in your particular situation).



      To calculate in and out counts, as you have requested in one of your comments to the above mentioned answer, you could extend my original suggestion like this:



      SELECT
      player,
      COUNT( is_in OR NULL) AS in_count,
      COUNT(NOT is_in OR NULL) AS out_count,

      COUNT(*) AS total_count
      FROM (
      SELECT
      x.is_in,
      CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
      FROM mytable t
      CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
      ) s
      GROUP BY
      player
      ;


      As you can see, the derived table now additionally returns the is_in column in its own right, and the column is used in two conditional aggregations for counting how many times a player was in and out. (If you are interested, the OR NULL trick is explained here.)



      You could also rewrite the COUNT(condition OR NULL) entries as SUM(condition). That would certainly shorten both expressions, some also find the SUM method of counting clearer/more elegant. In either event, there would likely be no difference in performance, so choose whichever method suits your taste better.



      A SQL Fiddle demo of the second query can be found here.






      share|improve this answer



























        2












        2








        2







        You could use a cross-join to a 2-row virtual table to unpivot the player_* columns, then group the results, like this:



        SELECT
        player,
        COUNT(*) AS total_count
        FROM (
        SELECT
        CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
        FROM mytable t
        CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
        ) s
        GROUP BY
        player
        ;


        That is, every row of the original table is essentially duplicated and each copy of the row supplies either player_in or player_out, depending on whether the derived table's is_in column is TRUE or FALSE, to form a single player column. This method of unpivoting might perform better than the UNION method suggested by @Bohemian because this way the (physical) table is passed just once (but you'd need to test and compare both methods to determine if there's any substantial benefit to this approach in your particular situation).



        To calculate in and out counts, as you have requested in one of your comments to the above mentioned answer, you could extend my original suggestion like this:



        SELECT
        player,
        COUNT( is_in OR NULL) AS in_count,
        COUNT(NOT is_in OR NULL) AS out_count,

        COUNT(*) AS total_count
        FROM (
        SELECT
        x.is_in,
        CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
        FROM mytable t
        CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
        ) s
        GROUP BY
        player
        ;


        As you can see, the derived table now additionally returns the is_in column in its own right, and the column is used in two conditional aggregations for counting how many times a player was in and out. (If you are interested, the OR NULL trick is explained here.)



        You could also rewrite the COUNT(condition OR NULL) entries as SUM(condition). That would certainly shorten both expressions, some also find the SUM method of counting clearer/more elegant. In either event, there would likely be no difference in performance, so choose whichever method suits your taste better.



        A SQL Fiddle demo of the second query can be found here.






        share|improve this answer















        You could use a cross-join to a 2-row virtual table to unpivot the player_* columns, then group the results, like this:



        SELECT
        player,
        COUNT(*) AS total_count
        FROM (
        SELECT
        CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
        FROM mytable t
        CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
        ) s
        GROUP BY
        player
        ;


        That is, every row of the original table is essentially duplicated and each copy of the row supplies either player_in or player_out, depending on whether the derived table's is_in column is TRUE or FALSE, to form a single player column. This method of unpivoting might perform better than the UNION method suggested by @Bohemian because this way the (physical) table is passed just once (but you'd need to test and compare both methods to determine if there's any substantial benefit to this approach in your particular situation).



        To calculate in and out counts, as you have requested in one of your comments to the above mentioned answer, you could extend my original suggestion like this:



        SELECT
        player,
        COUNT( is_in OR NULL) AS in_count,
        COUNT(NOT is_in OR NULL) AS out_count,

        COUNT(*) AS total_count
        FROM (
        SELECT
        x.is_in,
        CASE WHEN x.is_in THEN t.player_in ELSE t.player_out END AS player
        FROM mytable t
        CROSS JOIN (SELECT TRUE AS is_in UNION ALL SELECT FALSE) x
        ) s
        GROUP BY
        player
        ;


        As you can see, the derived table now additionally returns the is_in column in its own right, and the column is used in two conditional aggregations for counting how many times a player was in and out. (If you are interested, the OR NULL trick is explained here.)



        You could also rewrite the COUNT(condition OR NULL) entries as SUM(condition). That would certainly shorten both expressions, some also find the SUM method of counting clearer/more elegant. In either event, there would likely be no difference in performance, so choose whichever method suits your taste better.



        A SQL Fiddle demo of the second query can be found here.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 23 '17 at 12:11









        Community

        11




        11










        answered Jul 10 '13 at 0:21









        Andriy MAndriy M

        63.7k1379132




        63.7k1379132



























            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%2f17513129%2fmysql-count-id-that-appear-in-2-columns%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

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)