sql >> Database >  >> RDS >> Mysql

Tel mysql union-type query

Tel gewoon de resultaten van de subquery's...

SELECT COUNT(t.*) FROM
(   (SELECT 1 AS sort_col,performerid,pic0 
       FROM $table 
       WHERE performerid IS NOT NULL 
         $performeridSql) 
  UNION 
    (SELECT 2 AS sort_col,performerid,pic0 
       FROM $table 
       WHERE performerid IS NOT NULL 
         $categorySql $buildSql 
         $breastsize $haircolor $age $ethnicity 
         $willingnessSql)
  ORDER BY sort_col)
) AS t


  1. Parallellisme komt naar VACUUM

  2. Automatische gegevensversie in MariaDB Server 10.3

  3. Hoe MySQL-client automatisch opnieuw verbinden met MySQLdb inschakelen?

  4. Voeg twee kolommen samen, meerdere rijen en negeer duplicaten - MySQL