Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Visual Studio 2012中的SQL查询生成器中不工作的限制1_Mysql_Sql_Visual Studio 2012_Limit_Query Builder - Fatal编程技术网

Mysql Visual Studio 2012中的SQL查询生成器中不工作的限制1

Mysql Visual Studio 2012中的SQL查询生成器中不工作的限制1,mysql,sql,visual-studio-2012,limit,query-builder,Mysql,Sql,Visual Studio 2012,Limit,Query Builder,我正在尝试使用sqldatasource构建一个查询,其中只显示表中最近的列 SELECT* FROM CustomerB ORDER BY CustomerID DESC LIMIT 1 此函数在w3schools网站中工作,但错误是查询生成器中的限制为1。我得到的错误是无法解析查询文本,并且查询无法在图表和条件窗格中以图形方式表示。并且错误消息是“LIMIT”附近的语法不正确。假设您使用的是SQL Server try SELECT TOP 1 * FROM C

我正在尝试使用sqldatasource构建一个查询,其中只显示表中最近的列

    SELECT* FROM CustomerB
    ORDER BY CustomerID DESC
    LIMIT 1

此函数在w3schools网站中工作,但错误是查询生成器中的限制为1。我得到的错误是无法解析查询文本,并且查询无法在图表和条件窗格中以图形方式表示。并且错误消息是“LIMIT”附近的语法不正确。

假设您使用的是SQL Server try

SELECT TOP 1 *
  FROM CustomerB
 ORDER BY CustomerID DESC
这里是演示

Select * from CustomerB Order By CustomerID DESC Limit 0 , 1 ;
对于最后一个职位,如果您想要最后2个客户id,则使用

Select * from CustomerB Order By CustomerID DESC Limit 0 , 1 ;
Select * from CustomerB Order By CustomerID DESC Limit 1 , 1 ;
如果您只需要倒数第二个客户id,请使用

Select * from CustomerB Order By CustomerID DESC Limit 0 , 1 ;
Select * from CustomerB Order By CustomerID DESC Limit 1 , 1 ;
对于最后第三个位置值

Select * from CustomerB Order By CustomerID DESC Limit 2 , 1 ;

我将VisualStudio与SQL Server相关联,而不是与MySQL相关联。Datbase使用
top
而不是“limit”。