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....
TRy using AS in place of = :
select (select distinct(fldprecentage) from precentage where
fldgroup='Training' and fldset='First') AS trainPrecent1,
......
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.