我試圖插入新行的B/W現有行,但得到錯誤 我的DB如何在mysql中插入新行b/w現有行?
RoutePoint lat lon type
1 12.9061170343075 77.5724397120948 s
2 12.9209711117095 77.5601544553814 v
3 12.892986142953 77.4662127668475 v
4 12.9215410271329 77.5607713634547 s
查詢 -
String query1 = "UPDATE mytable SET RoutePoint =
RoutePoint + 1 where id > 3 "+"insert into rp(lat, lon,type) values (?,?,?)";
pstmt = con.prepareStatement(query1); // create a statement
pstmt.setDouble(1, 12.34234234);
pstmt.setDouble(2, 77.423423423); // set input parameter 2
pstmt.setString(3, s); // set input parameter 3
pstmt.executeUpdate(); // execute insert statement
但是我卻越來越無差錯
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
insert into rp(lat, lon,type) values (12.921343123349597,77.5601659236431,'s')
at line 1
請幫忙。
並不清楚到底是什麼你想幹什麼?如果我查詢他們saprately得到這個錯誤 - – 2015-03-25 07:57:43