0

我是 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。还有如何传递参数。

4

1 回答 1

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);
      }
   });
于 2013-10-03T12:00:08.013 回答