select line in crosstab format !? ~HELP ME !!

select line in crosstab format !? ~HELP ME !!

Post by Simon Loac » Thu, 07 Dec 2000 04:00:00



Hi All

I have a table that lists and id and a product number. Each id could be in
the table with several different product nos e.g

ID    Product
1      A7
1      B1
1      A6
2      A7
2      B2
3      A1
5      B2

Is there some way of writing my select line so that the results appear as :

1, a7, b1, a6
2, a7 , b2

Any help would be gratefully recieved

Regards Simon

 
 
 

select line in crosstab format !? ~HELP ME !!

Post by Steve Dassi » Thu, 07 Dec 2000 04:00:00


Hi,
Check out RAC (replacement for Access crosstab query) at:
www.angelfire.com/ny4/rac/
If you would like to try out beta for new version 1.50
exclusively for server 2000 contact me.

Steve

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

select line in crosstab format !? ~HELP ME !!

Post by Don Arsenaul » Thu, 07 Dec 2000 04:00:00


Need more information.  Your results don't seem like a crosstab.  Is "1, a7,
b1, a6" four separate columns or one column with the values concatenated
into a string and delimitted by a comma and space?  If separate columns,
what are the column names and how does value determine the column it belongs
in?  Why are your results missing ID 3 and 5?

Don.


Hi All

I have a table that lists and id and a product number. Each id could be in
the table with several different product nos e.g

ID    Product
1      A7
1      B1
1      A6
2      A7
2      B2
3      A1
5      B2

Is there some way of writing my select line so that the results appear as :

1, a7, b1, a6
2, a7 , b2

 
 
 

select line in crosstab format !? ~HELP ME !!

Post by mnobl.. » Fri, 08 Dec 2000 10:59:31


Hello
I have a similar problem...it may even be the same...I have something
like

col1   col2
1      A
1      B
1      C
2      D
2      E

and I want:

col1    col2
1       "A, B, C"
2       "D, E"

and so on.

Any help would be greatly appreciated.

Thanks!
Mike



> Need more information.  Your results don't seem like a crosstab.
Is "1, a7,
> b1, a6" four separate columns or one column with the values
concatenated
> into a string and delimitted by a comma and space?  If separate
columns,
> what are the column names and how does value determine the column it
belongs
> in?  Why are your results missing ID 3 and 5?

> Don.



> Hi All

> I have a table that lists and id and a product number. Each id could
be in
> the table with several different product nos e.g

> ID    Product
> 1      A7
> 1      B1
> 1      A6
> 2      A7
> 2      B2
> 3      A1
> 5      B2

> Is there some way of writing my select line so that the results
appear as :

> 1, a7, b1, a6
> 2, a7 , b2

Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

select line in crosstab format !? ~HELP ME !!

Post by Steve Dassi » Fri, 08 Dec 2000 11:22:22


Hi,
You can use RAC pivoting utility.

create table #b (col1 int,col2 varchar(5))
insert #b values(1,'A')
insert #b values(1,'B')
insert #b values(1,'C')
insert #b values(2,'D')
insert #b values(2,'E')


col1   col2
------ -----
1      A,B,C
2      D,E

Steve
Check out RAC (replacement for Access crosstab query) at:
www.angelfire.com/ny4/rac/
If you would like to try out the beta for new version 1.50
exclusively for sql server 2000 contact me.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

select line in crosstab format !? ~HELP ME !!

Post by Don Arsenaul » Sat, 09 Dec 2000 01:29:18


I just posted an algorithm just a couple days ago.

Look for...
    "Re: String concatenation in a vew"

    posted 12/5/2000 8:34PM.

Don.

Hello
I have a similar problem...it may even be the same...I have something
like

col1   col2
1      A
1      B
1      C
2      D
2      E

and I want:

col1    col2
1       "A, B, C"
2       "D, E"

 
 
 

1. Help with calculations in Select or crosstab (??)query

Hi--

I'm working with a commercial application written in VFP where I can't
write to any of the application's native tables, but can create cursors
& new tables in SELECT statements.

In the application is a table with the structure of:

Job#        Seq.       Parts Completed
555        10             1000
555        20              750
555        30              600
.
.
etc.

My client wants to know how many parts still need to be completed
(Queued up) at each sequence.

The math appears easy:

Seq10Parts Completed[1000] - Seq20PartsCompleted[750]  = Seq20Queue[250]

but how do I do that in a SELECT statement?

Or better yet, how can I convert  the data into the format of:

Job#        Seq10Cmpl    Seq20Cmpl    Seq30Cmpl      . . .    etc.
555            1000                750                600

(is that a crosstab query?????)

That way I know how to do the calculations and also would help with data
display & reporting.

Any help is greatly appreciated.

Terry (trying to be a consultant) Hogan

2. Urgent Please Help!!!

3. Multi-Line Text Boxes and advanced formatting help!

4. Using ADO 2.5 to call Oracle function to return a value

5. Loading XML formatted crosstab data to SQL Server

6. SYBASE SQR Reportwriter Developers - Chicago

7. Formatting Crosstab with Crystal Reports

8. 13505-ID-Idaho-DBA Skills-ORACLE Financials-ORACLE-Database Administrator

9. help: formatting select output

10. Help select "Best" PC Database format

11. Blank line between lines: HELP!

12. Databases: On-line vs Off-line ? Help please

13. Tricky SQL SELECT - Crosstab?