select id from book MINUS select id from new;

凤凰涅槃 2010-05-18 10:51:02
book和new分别是两表;
select id from book where id in( select id from new);
返回结果id
1
11
但是输入标题sql语句时候,提示

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('select id from new') at line 1;
...全文
453 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwwb 2010-05-18
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 hailongshih 的回复:]
5楼答案是正确的,为什么这里用别名呢?还有能解释下刚才intersect为什么执行不了
[/Quote]
mysql不支持intersect,别名也可以不用,缩短SQL语句长度
凤凰涅槃 2010-05-18
  • 打赏
  • 举报
回复
5楼答案是正确的,为什么这里用别名呢?还有能解释下刚才intersect为什么执行不了
wwwwb 2010-05-18
  • 打赏
  • 举报
回复
select a.id from book a inner join `new` b on a.id=b.id
凤凰涅槃 2010-05-18
  • 打赏
  • 举报
回复
select id from book intersect select id from 'new';
还是没有结果的
凤凰涅槃 2010-05-18
  • 打赏
  • 举报
回复
mysql5.1.40
ACMAIN_CHM 2010-05-18
  • 打赏
  • 举报
回复
select id from book where id in( select id from `new`);


new 加上反引号`
wwwwb 2010-05-18
  • 打赏
  • 举报
回复
MYSQL版本?
select `id` from book where `id` in( select `id` from `new`);
Book Description The CSS Anthology: 101 Essential Tips, Tricks & Hacks is a compilation of best practice solutions to the most challenging CSS problems. The third edition of this best-selling book, published in full color, has been completely revised and updated to cover the latest techniques and newer browsers, including Firefox 3 and Internet Explorer 8.It’s the most complete question-and-answer book on CSS, with over 100 tutorials that’ll show you how to gain more control over the appearance of your web page, create sophisticated Web page navigation controls, design for today’s alternative browsing devices including phones and screen readers, and much more. The CSS code used to create each of the components is available for download and guaranteed to be simple, efficient and cross-browser compatible. This book will show you how to: Construct robust CSS layouts that work every time. Create sleek drop-down menus using only CSS. Build a professional tabbed navigation system. Replace image-based navigation with low-fat CSS lists.Design smarter, more usable CSS-flavored web forms. Use rounded corners minus the bloated HTML. Allow your visitors to select their preferred look and feel. Let the W3C validator do your debugging. Reduce the burden of site maintenance and updates. … along with 92 other solutions to common questions and problems. The CSS Anthology: 101 Essential Tips, Tricks & Hacks is ideal for Web designers who would like to add sparkle to their existing designs, as well as newcomers who want to become true CSS masters. The book can be read cover to cover, or referred to like a cookbook with 101 different recipies for your Website. It’s written in an easy-to-follow, consistent format that’s well illustrated with plenty of full color screenshots and code examples, providing quick visual cues.
1 , vb5dialog.zipThis demonstrates how to subclass the Common Dialog Dialogs and manipulate a specific Dialog.2 , cpnl.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).3 , vbo_progbar.zipImplement a common control progress bar with added features that are not accessable using COMCTL32.OCX! 4 , vbo_infolabel.zipThis control adds a great user-friendly interface with and icon and "Hover" ability. Based on a control seen in ICQ. 5 , vbo_checkcombo.zipAdd a checkbox to a combo box and use it to enabled/disable the combo! or whatever you would like to do with it! 6 , vbo_controlframe.zipCreate your own system button such as a Maximize, Minimize, Close, and many others with ease! 7 , vbo_ctextbox.zipThis class makes using the Textbox or Edit class API simple. Easily set properties and access many features not available directly from VB. 8 , taskbar.zipForm_Taskbar is a control for Visual Basic which, once placed onto a form, makes the form act like the Taskbar (minus the Start Menu).9 , NT_Service.zipThis is an OCX that allows you to create an NT service application...add the control to your project and register it as a service!!10 , Scroller.zipThis is a Control Container, it's like a frame control but it lets you scroll the content up and down...11 , TrayArea.zipThis control lets you add your icon to the System Tray Area and handle some events such as MouseMove, MouseDown, MouseUp and DblClick.12 , Resizer.zipThis is a very useful control: It's a container control, you can insert two controls inside and then you'll have a vertical (or horizontal) resizer bar (like the Windows File Explorer). A resizer can contain another resizer... an so on. (you can divide you form in as many sizable sections as you want...).13 , Label3D.zipTh
可再发行编码 - 有限使用: msjet35.dll msjint35.dll msjter35.dll msrd2x35.dll msrepl35.dll expsrv.dll vbajet32.dll msexch35.dll msexcl35.dll mspdox35.dll msltus35.dll mstext35.dll msxbse35.dll MSJTOR35.DLL MSJT4JLT.DLL mdac_typ.exe msorcl32.dll msdaora.dll 可再发行代码 - 扩展的使用: comct232.ocx comct332.ocx comctl32.ocx comdlg32.ocx dblist32.ocx hhctrl.ocx mci32.ocx msadodc.ocx mschrt20.ocx mscomct2.ocx mscomctl.ocx mscomm32.ocx MSDatGrd.ocx msdatlst.ocx MSDatRep.ocx msflxgrd.ocx mshflxgd.ocx msinet.ocx msmapi32.ocx msmask32.ocx msrdc20.ocx mswinsck.ocx picclp32.ocx richtx32.ocx sysinfo.ocx tabctl32.ocx wbclsdsr.ocx anibtn32.ocx dbgrid32.ocx gauge32.ocx graph32.ocx grid32.ocx gswdll32.dll keysta32.ocx mschart.ocx msoutl32.ocx spin32.ocx threed32.ocx adodcchs.dll cmct2chs.dll cmct3chs.dll cmctlchs.dll cmdlgchs.dll datgdchs.dll datlschs.dll DatRpchs.DLL DBGRDCHS.DLL dblstchs.dll flxgdchs.dll mcichs.dll MsCc2chs.dll msch2chs.dll MSCMCCHS.DLL MSCOMCHS.DLL MSHFGCHS.DLL inetchs.dll MSMPICHS.DLL MSMSKCHS.DLL rdc20chs.dll WINSKCHS.DLL pcclpchs.dll rchtxchs.dll SYSINCHS.DLL TABCTCHS.DLL mswcrchs.dll MSCHTCHS.DLL 可再发行代码 - 标准: oleaut32.dll secur32.dll compobj.dll ole2.dll ole32.dll olecnv32.dll olethk32.dll rpcltc1.dll rpcltc5.dll rpcltccm.dll rpclts5.dll rpcltscm.dll rpcns4.dll rpcrt4.dll rpcss.exe storage.dll stdole2.tlb stdole32.tlb imagehlp.dll dllhost.exe comcat.dll iprop.dll rpcmqcl.dll rpcmqsvr.dll olepro32.dll asycfilt.dll mfc40.dll msvcrt40.dll dcomcnfg.exe oledlg.dll ciscnfg.exe dcomcnfg.hlp IE4\MSJavx86.exe os\system\atl.dll os\system\ansi\atl.dll VB98\template\code\loadres.bas VB98\template\code\RegKeys.BAS VB98\template\controls\ListBtns.frm VB98\template\controls\ListBtns.frx VB98\template\controls\listpick.frm VB98\template\controls\listpick.frx VB98\template\controls\tvlv.frm

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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