mysql 的order by

Armeng 2009-10-26 10:12:14
dm->InfoQuery->SQL->Add("select * from std ");
dm->InfoQuery->SQL->Add("where ID="+IntToStr(ID)+"order by age");
dm->InfoQuery->Open();


General SQL error [MySQL][ODBC 5.1 Driver][mysqld-5.0.67-community]You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the rught syntax to use near 'by age' at line 2'
Process stopped.Use Step or Run to continue


语句在linux下用mysql直接执行没有问题...

是BDE和ODBC的问题么?
...全文
43 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Armeng 2009-10-29
  • 打赏
  • 举报
回复
4楼正解

感谢各位...
我不懂电脑 2009-10-26
  • 打赏
  • 举报
回复
用dbexpress连接是直接使用的mysql驱动
jamesyue2008 2009-10-26
  • 打赏
  • 举报
回复
order by 前面要加一个空格
lurel 2009-10-26
  • 打赏
  • 举报
回复
看一下是不是字段定义的问题,把Id=''试试
Armeng 2009-10-26
  • 打赏
  • 举报
回复
我用的BDE+ODBC,没用DBExpress

其实就是比较奇怪这个orde4r by 的问题...

为什么会出错

1,178

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 数据库及相关技术
社区管理员
  • 数据库及相关技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧