niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
sql with multiple aliases, multirow record
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Frank Piron
*nix forums beginner


Joined: 27 Apr 2005
Posts: 7

PostPosted: Thu Feb 10, 2005 10:54 am    Post subject: Re: sql with multiple aliases, multirow record Reply with quote

Hi,
Am 10 Feb 2005 02:15:03 -0800 schrieb Mariusz <mr.m@biaman.pl>:

<snip>
</snip>
Quote:
When I run:
select a.ID, concat(a.text, concat(b.text, c.text)) from T1 a, T1 b, T1 c
where a.code='123' and b.code='124' and c.code='322';

I get:
1 aa bb dd
2 ff gg dd

So, c.text is appened from previous row. How to clear c.text before next
pass ?

It should return:

1 aa bb dd
2 ff gg

I other words, how to select one row data from multi-row record ?
Regards,
mariusz

If i got you right, you have to ensure that your data sources
share a common id:

select a.ID, concat(a.text, concat(b.text, c.text)) from T1 a, T1 b, T1 c
where a.code='123' and b.code='124' and c.code='322' and
a.id=b.id=c.id;

regards
--
Frank Piron,
defrankatkonaddot
(leftrotate two)
Back to top
Mariusz
*nix forums beginner


Joined: 01 Mar 2005
Posts: 8

PostPosted: Thu Feb 10, 2005 9:15 am    Post subject: sql with multiple aliases, multirow record Reply with quote

Hello,

I have table T1 with multiple row record:

ID code text
1 123 aa \
1 124 bb \
1 134 cc / one logical record
1 322 dd /
2 123 ff
2 124 gg
2 344 hh
3 ...........
3 ............
........
...........

When I run:
select a.ID, concat(a.text, concat(b.text, c.text)) from T1 a, T1 b, T1 c
where a.code='123' and b.code='124' and c.code='322';

I get:
1 aa bb dd
2 ff gg dd

So, c.text is appened from previous row. How to clear c.text before next pass ?

It should return:

1 aa bb dd
2 ff gg

I other words, how to select one row data from multi-row record ?
Regards,
mariusz
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 6:34 pm | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix Multiple Relay Hosts? blaze Postfix 0 Wed Jun 25, 2008 5:02 am
No new posts Regular Expression Aliases in Postfix attila2008 Postfix 0 Fri Mar 07, 2008 1:03 am
No new posts Aliases with regular expression attila2008 Postfix 0 Fri Mar 07, 2008 1:01 am
No new posts Deliver msg to multiple hosts jures Postfix 2 Fri Feb 29, 2008 4:21 pm
No new posts Multiple Inheritance colint C++ 5 Thu Jul 20, 2006 2:29 pm

Business Credit Cards | Read Manga Online | Mortgages | Final Fantasy | Read Free Manga Online
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1904s ][ Queries: 20 (0.1098s) ][ GZIP on - Debug on ]