4

mssql を使用して質問セットをカウントする手順を作成しました。そのクエリを以下に投稿します。今、私は以下のクエリをmysqlに変換したいのですが、エラーを返します.このエラーを修正するのを手伝ってください..

私の部分的なクエリはここにあります...

     select trainPrecent1 = (select distinct(fldprecentage) from precentage  where    fldgroup='Training' and fldset='First'),
     trainPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Training' and fldset='Second'),
     agentPrecent1 = (select distinct(fldprecentage) from precentage where fldgroup='Agent on floor' and fldset='First'),
     agentPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Agent on floor' and fldset='Second'), 
     superPrecent1 = (select distinct(fldprecentage) from precentage where fldgroup='Supervisor on floor' and fldset='First'), 
     superPrecent2 = (select distinct(fldprecentage) from precentage where fldgroup='Supervisor on floor' and fldset='Second')

現在、次のエラーが発生しています...

 "unknown column name "trainPrecent1" in fielelist...

このエラーを修正するのを手伝ってください....

4

1 に答える 1

4

=の代わりにASを使用してみてください:

select (select distinct(fldprecentage) from precentage  where    
fldgroup='Training' and fldset='First') AS trainPrecent1,
......
于 2012-05-15T04:29:26.620 に答える