Mysql 手册中这段话是什么意思 有什么用途?
3.7. Queries from the Twin Project
[+/-]
3.7.1. Find All Nondistributed Twins
3.7.2. Show a Table of Twin Pair Status
At the places the early MySQL was developed (Analytikerna and Lentus), the founders did systems and field work for a big research project. This project was a collaboration between the Institute of Environmental Medicine at Karolinska Institutet Stockholm and the Section on Clinical Research in Aging and Psychology at the University of Southern California. 

解决方案 »

  1.   

    3.7.2. Show a Table of Twin Pair Status
    Each twin has a status code called event. The query shown here is used to select all twin pairs combined by event. This indicates in how many pairs both twins are finished, in how many pairs one twin is finished and the other refused, and so on. 
    SELECT
            t1.event,
            t2.event,
            COUNT(*)
    FROM
            lentus AS t1,
            lentus AS t2,
            twin_project AS tp
    WHERE
            /* We are looking at one pair at a time */
            t1.id = tp.id
            AND t1.tvab=tp.tvab
            AND t1.id = t2.id
            /* Just the screening survey */
            AND tp.survey_no = 5
            /* This makes each pair only appear once */
            AND t1.tvab='1' AND t2.tvab='2'
    GROUP BY
            t1.event, t2.event;
      

  2.   

    Queries from the Twin Project