there're lots of ways to do this. The first choice is create a view. But seems your table is not normalized. 

解决方案 »

  1.   

    你的表结构不好!
    如果现在不是四门功课你如何处理1
    假如又有一个英语
    !你就要改表结构1
    方法是有的
    select t.p_name,count(t.p_score)
    from
    (
    select 姓名 as p_name,语文 as P_score from tablename
    union
    select 姓名,数学 from tablename
    union
    select 姓名,物理  from tablename
    unio
    select 姓名,化学  from tablename
    ) as t
    where t.p_score<60
    group by t.p_name
      

  2.   

    select 姓名,科目="语文",语文 as 成绩 where 语文<60
    union
    select 姓名,科目="数学",数学 as 成绩 where 数学<60
    union
    select 姓名,科目="物理",物理 as 成绩 where 物理<60
    union
    select 姓名,科目="化学",化学 as 成绩 where 化学<60
      

  3.   

    select a.姓名 "姓名",b.column_name "科目" from table a,all_col_comments b where 
    (select column_name from col_col_comments where (table_name=table)and(column_name<>'姓名'))<60 group by a.姓名
      

  4.   

    是要用 union 表连起来
    zoukaix()和
    wwl007(疑难杂症) 
    的方法都可以前者的效率要搞些
    最好还是改表结构
    姓名 科目 成绩 
      

  5.   

    老鬼的看法是对的。而且是根本上提高效率。建议加10分,www1007加5分,zoukaix加5分
    jone