home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / sybase / 657 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  2.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!olivea!sgigate!odin!powerplay.asd.sgi.com!dptom
  2. From: dptom@powerplay.asd.sgi.com (Tom Arnold)
  3. Newsgroups: comp.databases.sybase
  4. Subject: Re: Query Question
  5. Message-ID: <1993Jan12.235233.14795@odin.corp.sgi.com>
  6. Date: 12 Jan 93 23:52:33 GMT
  7. References: <1993Jan8.204249.6995@mercury.cair.du.edu>
  8. Sender: news@odin.corp.sgi.com (Net News)
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 43
  11. Nntp-Posting-Host: powerplay.asd.sgi.com
  12.  
  13. In article <1993Jan8.204249.6995@mercury.cair.du.edu>,
  14. elinden@diana.cair.du.edu (Elwood Blues) writes:
  15. |> What I want is for one record per store and 5 columns as follows
  16. |> 
  17. |> store   reg   OT      sunday     sundayOT 
  18. |> -------------------------------------------
  19. |> store1  800   40      30         10
  20. |> etc.
  21. |> 
  22. |> Any ideas would be greatly appreciated.  There are many circumstances in
  23. |> which
  24. |> I would like to have a single field (hours) displayed in multiple
  25. |> columns.
  26.  
  27. I'm assuming that the table contains something like payroll transactions
  28. and you want to view display/print the results in an array for each store.
  29. The available syntax in SQL isn't going to help you very much. Depending on
  30. the report/writing tools that you have available to you, you might want to
  31. try one of them. Shy of this, a quick 'C' program will do the trick. 
  32.  
  33. Now... A less attractive way to do this would be to create a "temp-type"
  34. table that looks like "store_data(store, reg, ot, sunday, sundayot)" and
  35. load the data into it using some stored procedure.  This table could be
  36. persistent for a period of time and users could query against it to get the
  37. appropriate data in a format that they like. The stored procedure could
  38. update the table over some interval and all might be okay. Unfortunately,
  39. this may be more work than is necessary for a simple report and it may be
  40. better to take the first alternative.  
  41. -- 
  42. ***************************************************************************
  43. **
  44. *       Tom Arnold                    | "When you step in the ocean       
  45. *
  46. *       dptom@sgi.com                 |   you become a part of the        
  47. *
  48. *       Silicon Graphics, Inc.        |    food chain."                   
  49. *
  50. *       (we do it in three            |                                   
  51. *
  52. *        dimensions)                  |                                   
  53. *
  54. ***************************************************************************
  55. **
  56.