Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #335 > unrolled thread
| Started by | "skywalker" <skywalker@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:23 +0000 |
| Last post | 2011-04-27 15:23 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.databases
how to generate the follo "skywalker" <skywalker@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: how to generate the f "Martin Gregorie" <martin.gregorie@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
| From | "skywalker" <skywalker@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | how to generate the follo |
| Message-ID | <20e2be1a-6eb0-4403-b8de-f94d8c94ff80@40g2000prx.googlegroups.com> |
To: comp.lang.java.databases
I am really really new to sql,please forgive my
ignorence.
here is my problem
I have this table named mis_outtrack
desc mis_outtrack;
+-------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| pub_code | varchar(3) | YES | | NULL | |
| status_flag | varchar(2) | YES | | NULL | |
| user_id | varchar(15) | YES | | NULL | |
| entry_date | date | YES | | NULL | |
| pub_date | date | YES | | NULL | |
+-------------+-------------+------+-----+---------+-------+
select * from mis_outtrack;
+----------+-------------+---------+------------+------------+
| pub_code | status_flag | user_id | entry_date | pub_date |
+----------+-------------+---------+------------+------------+
| SND | RE | AMY | 2008-11-01 | 2008-11-01 |
| SND | AU | AMY | 2008-11-05 | 2008-11-01 |
| SND | SE | AMY | 2008-11-10 | 2008-11-01 |
| MND | RE | AMY | 2008-11-03 | 2008-11-02 |
| MND | AU | AMY | 2008-11-15 | 2008-11-02 |
| MND | SE | AMY | 2008-11-15 | 2008-11-02 |
+----------+-------------+---------+------------+------------+
here pub_code is short name for a particular news paper
useid is the user who is updating the records
pub_date is the date of publication of that news paper
and
entry_date is the date when the user is updating the inserting
the status of that publication
here RE means recieved
AU means audited
SE means send
there can only be these three status flags
I have to write an sql to display this data in the following format
------------------------------------------------------------------------------------------------------------
pub_code |entry_date |entry_date |entry_date |
pub_date |
(for a |(when | (when |
(when |(publication |
particular |status was RE)|status was AU)|status was SE |date
for |
pub_code) | |
| |that news paper|
--------------------------------------------------------------------------------------------------------------
| SND 2008-11-01 2008-11-05 2008-11-10
2008-11-01
| MND 2008-11-03 2008-11-15 2008-11-15
2008-11-02
|
|
how can I do this in sql
any help will be appriciated.
Thanks in advance
---
* Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [next] | [standalone]
| From | "Martin Gregorie" <martin.gregorie@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:23 +0000 |
| Subject | Re: how to generate the f |
| Message-ID | <gfa0p2$prl$1@localhost.localdomain> |
| In reply to | #335 |
To: comp.lang.java.databases On Mon, 10 Nov 2008 09:12:12 -0800, skywalker wrote: > how can I do this in sql > You don't seem to have asked anything that's relevant to Java database programming. This question is best asked in an SQL newsgroup, preferably one dealing with whatever database you're using. When you do so, show them what you've done so far. That way they'll know that you've made some effort to solve this problem yourself. -- martin@ | Martin Gregorie gregorie. | Essex, UK org | --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.databases
csiph-web