concatenation

ORDER BY suddenly conflicting with VARCHAR concatenation in TSQL

China☆狼群 提交于 2020-01-11 11:45:26
问题 I have code in Sql Server 2008 which concatenates some strings from a query into a variable using the tried-and-true SELECT @VAR = @VAR + FIELD FROM TABLE ORDER BY OTHERFIELD syntax. This is my exact SQL: SELECT @SQL = @SQL + ISNULL(FORMULA, CASE WHEN USEMAP = 1 THEN 'dbo.getFieldTranslation('+CONVERT(VARCHAR,ROWID)+', [' + ISNULL(ENCOMPASSFIELD,'') + '])' ELSE '[' + ISNULL(ENCOMPASSFIELD,'') + ']' END ) + ' AS "' + FILECOLNAME + '",' + @CRLF FROM dbo.EXPORTMAP_EX WHERE WAREHOUSEID = @WHSID

concatenate unknown number of column and rows [duplicate]

独自空忆成欢 提交于 2020-01-11 11:29:29
问题 This question already has an answer here : TEXTJOIN for xl2010/xl2013 with criteria (1 answer) Closed 2 years ago . I am trying something since a couple of days and I am really lost about it. Could someone help me about it please. I would like to concatenate columns in Excel from the first column to the last non-empty column and add a comma between each column. Following that, I would like to apply the loop from the first line to the last non-empty line. I succeed to do it with a known number

Concatenating strings

為{幸葍}努か 提交于 2020-01-11 03:15:33
问题 I want to join a vector<string> into a single string , separated by spaces. For example, sample string for this example should become "sample string for this example" . What is the simplest way to do this? 回答1: #include <iterator> #include <iostream> #include <sstream> #include <vector> #include <algorithm> std::vector<std::string> v; ... std::stringstream ss; std::copy(v.begin(), v.end(), std::ostream_iterator<std::string>(ss, " ")); std::string result = ss.str(); if (!result.empty()) {

Concatenating bits in VHDL

感情迁移 提交于 2020-01-10 10:14:12
问题 How do you concatenate bits in VHDL? I'm trying to use the following code: Case b0 & b1 & b2 & b3 is ... and it throws an error Thanks 回答1: The concatenation operator '&' is allowed on the right side of the signal assignment operator '<=', only 回答2: Here is an example of concatenation operator: architecture EXAMPLE of CONCATENATION is signal Z_BUS : bit_vector (3 downto 0); signal A_BIT, B_BIT, C_BIT, D_BIT : bit; begin Z_BUS <= A_BIT & B_BIT & C_BIT & D_BIT; end EXAMPLE; 回答3: You are not

Concatenating bits in VHDL

人走茶凉 提交于 2020-01-10 10:12:31
问题 How do you concatenate bits in VHDL? I'm trying to use the following code: Case b0 & b1 & b2 & b3 is ... and it throws an error Thanks 回答1: The concatenation operator '&' is allowed on the right side of the signal assignment operator '<=', only 回答2: Here is an example of concatenation operator: architecture EXAMPLE of CONCATENATION is signal Z_BUS : bit_vector (3 downto 0); signal A_BIT, B_BIT, C_BIT, D_BIT : bit; begin Z_BUS <= A_BIT & B_BIT & C_BIT & D_BIT; end EXAMPLE; 回答3: You are not

Efficient way to combine multiple text files

坚强是说给别人听的谎言 提交于 2020-01-10 08:46:07
问题 I have multiple files of text that I need to read and combine into one file. The files are of varying size: 1 - 50 MB each. What's the most efficient way to combine these files without bumping into the dreading System.OutofMemoryException ? 回答1: Do it in chunks: const int chunkSize = 2 * 1024; // 2KB var inputFiles = new[] { "file1.dat", "file2.dat", "file3.dat" }; using (var output = File.Create("output.dat")) { foreach (var file in inputFiles) { using (var input = File.OpenRead(file)) { var

Concatenating 2D plots

情到浓时终转凉″ 提交于 2020-01-09 11:53:10
问题 I have several 2D-plots in MATLAB. In each plot there are some lines (each line is a row-vector of values of fixed length). There is always a base line (black one) and the remaining colored lines may or may not be present. , . I need to concatenate all such plots into one plot as shown below: Please note these are just for representational purpose but explain my problem well. I am not able to figure how to do it. Anybody got an idea? An example may be? Also, there has to be a vertical gap

Segmentation fault using strcat

我与影子孤独终老i 提交于 2020-01-09 05:43:04
问题 Here is my code : char *name, name_log="log-"; ------getting 'name' from user----- strcat(name_log, name); char ext[] = ".log"; strcat(name_log, ext); What i need to end up with is name_log = "log-'name'.log" but Im getting a segmentation fault error :((. What am I doing wrong and how can I fix it ? Thx 回答1: For a start, if this is your code: char *name, name_log="log-"; then name_log is a char, not a char pointer. Assuming that's a typo, you cannot append to string literals like that.

Concatenate and group multiple rows in Oracle [duplicate]

半城伤御伤魂 提交于 2020-01-08 17:15:12
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: how to retrieve two columns data in A,B format in Oracle Suppose I have a table like this: NAME GROUP_NAME name1 groupA name2 groupB name5 groupC name4 groupA name3 groupC I'd like to have a result like this: GROUP_NAME NAMES groupA name1,name4 groupB name2 groupC name3,name5 If there were only one column in the table, I could concatenate the records by doing the following, but with grouping in the context, I

Concatenate and group multiple rows in Oracle [duplicate]

感情迁移 提交于 2020-01-08 17:15:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: how to retrieve two columns data in A,B format in Oracle Suppose I have a table like this: NAME GROUP_NAME name1 groupA name2 groupB name5 groupC name4 groupA name3 groupC I'd like to have a result like this: GROUP_NAME NAMES groupA name1,name4 groupB name2 groupC name3,name5 If there were only one column in the table, I could concatenate the records by doing the following, but with grouping in the context, I