home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / sybase / 598 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.2 KB  |  37 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!fcom.cc.utah.edu!fcom.cc.utah.edu!rob
  3. From: rob@fosters.med.utah.edu (Rob Sargent)
  4. Subject: Re: SQL sort problems (group by?)
  5. In-Reply-To: sreit@ctp.com's message of 4 Jan 93 19:38:01 GMT
  6. Message-ID: <ROB.93Jan5113657@fosters.med.utah.edu>
  7. Sender: news@fcom.cc.utah.edu
  8. Organization: University of Utah
  9. References: <1993Jan4.193801.25423@ctp.com>
  10. Date: 5 Jan 93 11:36:57
  11. Lines: 24
  12.  
  13.  
  14. My first inclination would be to peal off the last two digits of the
  15. Claim # into a separate column in the result/report/temp_table, then
  16. use it in your ordering.
  17.  
  18. If claim number is an int you would have to do something like
  19.     sub_no = substring(convert(varchar(15), claim_no),
  20.                       datalenght(convert(varchar(15), claim_no)) -2,
  21.                       2)
  22.  
  23. or better interms of numberic, rather than alphabetic, sort ordering
  24.  
  25.     sub_no =  claim_no % 100
  26.  
  27. but this would drop leading zero (if you care).
  28.  
  29. rjs
  30.  
  31. --
  32. Rob Sargent                      s-mail: Dept. of Human Genetics    
  33. e-mail: rob@fosters.med.utah.edu         U. of Utah Medical School     
  34.                          Eccles Genetics Bldg
  35.                          Salt Lake City, Utah  84112
  36.  
  37.