4

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....

1 Answer 1

4

TRy using AS in place of =:

select (select distinct(fldprecentage) from precentage  where    
fldgroup='Training' and fldset='First') AS trainPrecent1,
......
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.