Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Other SQL Server Topics / May 2008

Tip: Looking for answers? Try searching our database.

Result on a single line

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amiro - 28 May 2008 14:30 GMT
Hi,

Using MS Query, I like to query an Informix database and get the result of
multiple rows on a single line. I would like to end up with a specific
colomn showing the result on a signle line which include several rows like
this

Col 1 - Col 2 - Col 3 - Col 3 - Col 3 - Col 3
data      data     data1   data2    data3    data4

Instead of

Col 1 - Col 2 - Col 3
data      data     data1
                       data2

Can I do that in MS Query?

Thanks in advance.

Amiro
                       data3
Rubén Garrigós - 28 May 2008 15:19 GMT
You can concatenate the columns with:

select col1, col2, col31 + col32 + col33 as col3 from...

Signature

Rubén Garrigós
Solid Quality Mentors

> Hi,
>
[quoted text clipped - 18 lines]
> Amiro
>                        data3
Amiro - 28 May 2008 15:32 GMT
Thanks for replying but it doesn't work. I got an error message. I think it
doesn't like the + sign...
Here is the query:

SELECT inv2.in2_in1_code, inv2.in2_loc_mag, inv2.in2_en1_code, loc1.lc1_loc,
loc1.lc1_seq, loc1.lc1_date
FROM prog.inv2 inv2, prog.loc1 loc1
WHERE loc1.lc1_en1_code = inv2.in2_en1_code AND loc1.lc1_in1_code =
inv2.in2_in1_code AND ((inv2.in2_en1_code='3') AND
(inv2.in2_in1_code='2001492'))

loc1.lc1_loc is the column that we need the data to show on several columns.

Amiro

> You can concatenate the columns with:
>
[quoted text clipped - 22 lines]
>> Amiro
>>                        data3
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.