Amulraj
Amulraj

Reputation: 269

error for converting mssql to mysql

I was create a procedure for counting a question set using mssql. I post that query below. Now i want to convert the below query to mysql but it returns error.Please help me to fix this error..

My partial query is here...

     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')

Now am getting the following error...

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

Please help me to fix this error....

Upvotes: 4

Views: 80

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

TRy using AS in place of =:

select (select distinct(fldprecentage) from precentage  where    
fldgroup='Training' and fldset='First') AS trainPrecent1,
......

Upvotes: 4

Related Questions