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