home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / sybase / 11 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.3 KB  |  39 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!shearson.com!newshost!wfinnert
  3. From: wfinnert@larry.shearson.com (Warren Finnerty)
  4. Subject: Re: Sequencer or Serial
  5. In-Reply-To: pburry@manitou.cse.dnd.ca's message of Tue, 15 Sep 92 02:55:50 GMT
  6. Message-ID: <WFINNERT.92Sep15121450@larry.shearson.com>
  7. Sender: news@shearson.com (News)
  8. Organization: Lehman Brothers
  9. References: <14821@gazette.bcm.tmc.edu> <howard.716504676@judy.cs.iastate.edu>
  10.     <06ynl+l.mcentral@netcom.com>
  11.     <1992Sep15.025550.27360@manitou.cse.dnd.ca>
  12. Date: Tue, 15 Sep 1992 17:14:50 GMT
  13. Lines: 24
  14.  
  15. >In article <1992Sep15.025550.27360@manitou.cse.dnd.ca> pburry@manitou.cse.dnd.ca (Paul Burry) writes:
  16. >
  17. >   In article <06ynl+l.mcentral@netcom.com> mcentral@netcom.com (Media Central) writes:
  18. >   . . .
  19. >   |begin tran
  20. >   |   update sequenc set col = col + 1        /* update first and then read */
  21. >   |   select @latest = col from sequenc where 1 = 1
  22. >   |end tran
  23. >   . . .
  24. >
  25. >   Why the 'where 1 = 1' ?  Is this some obscure optimizer work-around?
  26.  
  27. Not needed I assure you.
  28. However you might choose to use:
  29.  
  30. select @latest = max(col) from sequenc
  31.  
  32. That syntax makes it obv. what you are getting back.
  33. Personal pref. I guess.
  34. --
  35. warren finnerty      | 388 Greenwich St.
  36. Lehman Brothers      | NYC NY 10013
  37. "Back off man!"      | wfinnert@shearson.com
  38.  
  39.