我是windows azure的新手。请帮帮我。
我该怎么写这个查询:
"SELECT catchup.*,news.text from catchup,news where news.deviceID = catchup.deviceID AND news.name = '$name' ORDER BY id DESC";
我用这种格式来写它
mssql.query('SELECT t.text, t.complete, p.description FROM ToDoItem as t INNER JOIN Priority as p ON t.priority = p.number', {
success: function(results) {
console.log(results);
},
error: function(err) {
console.log("error is: " + err);
});
但它给出错误代码500.还有如何传递参数。
答案 0 :(得分:0)
var sql = "SELECT t.text, t.complete, p.description FROM ToDoItem as t INNER JOIN Priority as p ON t.priority = p.number AND t.text = ?";
var name = '$name';
mssql.query(sql, [name], {
success: function(results) {
console.log(results);
},
error: function(err) {
console.log("error is: " + err);
}
});