【SQL】语句鉴赏
navicate---->
SELECT concat("\'",policy_no),province_id,province_name,
convert(policy_address using gb2312),
matche_address,match_probability
into OUTFILE 'd:/4.xls'
FROM `beijing2`;
SELECT concat("'",policy_no),province_id,province_name,
convert(policy_address using gb2312),
matche_address,match_probability
into OUTFILE 'd:/5.xls'
FROM `beijing2`;
<-----------------------------------
java中的sql----------------------->
String sql = "select "
+"concat(\"\'\",policy_no),"
+"concat(\"\'\",province_id),"
+ "convert(province_name using gb2312),convert(matche_address using gb2312),"
+" match_probability FROM beijing2 "
+" into outfile 'd:/temp/10.xlsx'";
String sql = "select "
+"concat(\"\\'\",policy_no), province_id,"
+ "convert(province_name using gb2312),convert(matche_address using gb2312),"
+" match_probability FROM beijing2 "
+" into outfile 'd:/temp/2.xls'";
<----------------------------------------------