Article View: borland.public.interbase.sql
Article #834create columns from multiple rows
From: aleplgr
Date: Fri, 18 May 2007 12:31
Date: Fri, 18 May 2007 12:31
15 lines
1843 bytes
1843 bytes
Hi! I have MYTABLE with this columns: C_PATIENT, DATE, ITEM,POINTS where C_PATIENT is the patient's code that identifies the patient, DATE is the date that a test is applied to that patient ITEM is the item (a question) of the test and POINTS are the points the patient took that date for that item. Each test is applied more than once to a patient in different dates, and I need to create a NEWTABLE that looks like this: C_PATIENT, DATE1,ITEM11, DATE2,ITEM12, DATE3,ITEM13, DATE4,ITEM14, DATE5,ITEM15 ITEM11=ITEM12= ITEM13=ITEM14= ITEM15 ='Item' it's the only item that we have to use for creating NEWTABLE NEWTABLE has 11 columns, result of each application of the test and each row contains the patient code, the test dates and the POINTS he took in 'Item'. The test is applied at most 5 times to each patient, some patients took the test once, others twice, other 3 times, other 4 times and others 5 times. The question 'Item' in MYTABLE never has a null value. Thanks for your time.
Technical Details
Message-ID:
<464d9ca7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,88e42a70093b1bab,start X-Google-Attributes: gid114a0e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "aleplgr" <aleplgr@yahoo.es> Sender: "aleplgr" <aleplgr@yahoo.es> Reply-To: "aleplgr" <aleplgr@yahoo.es> Subject: create columns from multiple rows Newsgroups: borland.public.interbase.sql X-User-Info: 80.58.205.38 X-Forwarded-For: 80.25.195.180, 192.168.1.66 NNTP-Posting-Host: 207.105.83.66 Message-ID: <464d9ca7$1@newsgroups.borland.com> Date: 18 May 2007 05:31:35 -0700 X-Trace: newsgroups.borland.com 1179491495 207.105.83.66 (18 May 2007 05:31:35 -0700) Lines: 16 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail