Click here to Skip to main content
15,902,818 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want insert more than two line qry insert in single column with more single quotes

What I have tried:

Insert into TEMP_TABLE(userid,chartid,id,qry,y1,y2)Values('1','chart0','chart0',' select ef_week as text,Sum(actualproduction) as actualproduction , avg (Productionefficiency) as productionefficiency from EFFICIENCY where actualproduction !=0 and date(ReportDate) between '2016-01-01' and '2016-08-29' group by ef_week order by ef_week ','actualproduction','Productionefficiency')
Posted
Updated 29-Aug-16 22:37pm

Please refer to the documentation :
MySQL: 10.1.1 String Literals[^]
You have to escape the quotes when you want them to be present in the string (see Table 10.1 Special Character Escape Sequences in above link).
 
Share this answer
 
Comments
Maciej Los 29-Aug-16 11:41am    
5ed!
phil.o 29-Aug-16 12:09pm    
Thanks :)
Use a parameterized query. That will handle quotes, date formats, etc. automagically, and also provide good protection with SQL injection attacks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900