I need help with the following mysql query.. Thanks

Discussion in 'MySQL' started by miko, Dec 7, 2007.

  1. #1
    I have 6 tables with the same structure. There is a field name called 'source' that has duplicate values. I want to be able to see the count and list the names of duplicate 'source' fields in all 6 tables.


    This is what I'm using currently for one table.

    SELECT COUNT(*) AS repetitions, source FROM table1 GROUP BY source;


    SELECT COUNT(*) AS repetitions, source FROM table1,table2, table3,... table6 GROUP BY source; <--- Does not work.. or I cannot but * in the from,....

    Please help..

    Thanks
     
    miko, Dec 7, 2007 IP
  2. satusaja

    satusaja Active Member

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    I'm not really clear about the problem. I need more info:
    1. why do u have 6 tables with the same structure? If they are simliar info, why not store them all in 1 table?
    2. why do u need to query all of them at the same time?
     
    satusaja, Dec 8, 2007 IP