All Questions

1349
votes
39answers
1630563 views

Concatenate many rows into a single text string?

Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this into a single string of Peter, Paul, Mary?
269
votes
16answers
357100 views

How to use GROUP BY to concatenate strings in SQL Server?

How do I get: id Name Value 1 A 4 1 B 8 2 C 9 to id Column 1 A:4, B:8 2 C:9
1016
votes
30answers
718538 views

Shortcuts in Objective-C to concatenate NSStrings

Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general? For example, I'd like to make: NSString *myString = @"Th...
48
votes
19answers
346341 views

How do I concatenate two strings in Java?

I am trying to concatenate strings in Java. Why isn't this working? public class StackOverflowTest { public static void main(String args[]) { int theNumber = 42; System.out.pri...
1857
votes
26answers
2309480 views

How to concatenate string variables in Bash?

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes "Hello World". How is this accomplished in Bash?
31
votes
7answers
71351 views

Is there an Oracle SQL query that aggregates multiple rows into one row?

I have a table that looks like this: A 1 A 2 B 1 B 2 And I want to produce a result set that looks like this: A 1 2 B 1 2 Is there a SQL statement that will do this? I am using Oracle. Rel...
125
votes
5answers
77759 views

Concatenating null strings in Java

Why does the following work? I would expect a NullPointerException to be thrown. String s = null; s = s + "hello"; System.out.println(s); // prints "nullhello"
94
votes
7answers
69244 views

Why is string concatenation faster than array join?

Today, I read this thread about speed of string concatenation. Surprisingly, string concatenation was the winner: http://jsben.ch/#/OJ3vo The result was opposite from what I thought. Besides, ...
270
votes
10answers
366266 views

How can 2 strings be concatenated?

How can I merge/combine two value in R? For example I have: tmp = cbind("GAD", "AB") tmp # [,1] [,2] # [1,] "GAD" "AB" My goal is to get tmp as one string tmp_new = "GAD,AB" Which Functio...
79
votes
4answers
143727 views

SQL NVARCHAR and VARCHAR Limits

All, I have a large (unavoidable) dynamic SQL query. Due to the number of fields in the selection criteria the string containing the dynamic SQL is growing over 4000 chars. Now, I understand that ther...

Previous Next