concat

Concat rows in Postgres

一个人想着一个人 提交于 2019-12-24 16:48:51
问题 Given is a Postgres table like this nummer vorname name cash ------|-----------|-----------|----- 1 paul smith 500 2 andy london 700 2 mike dover 700 3 clara winchester 200 To query this table my sql looks like this right know: SELECT nummer, vorname, name, cash as total FROM data.myTable GROUP BY nummer, name, vorname, cash ORDER BY nummer; Is it possible to concat the two rows where nummer is the same (in this case 2 ). Means my output should look like this (cash will also have the same

Concat rows in Postgres

泪湿孤枕 提交于 2019-12-24 16:48:04
问题 Given is a Postgres table like this nummer vorname name cash ------|-----------|-----------|----- 1 paul smith 500 2 andy london 700 2 mike dover 700 3 clara winchester 200 To query this table my sql looks like this right know: SELECT nummer, vorname, name, cash as total FROM data.myTable GROUP BY nummer, name, vorname, cash ORDER BY nummer; Is it possible to concat the two rows where nummer is the same (in this case 2 ). Means my output should look like this (cash will also have the same

Merging multiple pandas datasets with non-unique index

泄露秘密 提交于 2019-12-24 16:13:59
问题 I have several similarly structured pandas dataframes stored in a dictionary. I access a dataframe in the following way. ex_dict[df1] date df1price1 df1price2 10-20-2015 100 150 10-21-2015 90 100 I want to merge all of these dataframes into one dataframe by date. The dates are overlapping, but not all dataframes include all dates. I need to go from this df1 date df1price1 df1price2 10-20-2015 100 150 10-21-2015 90 100 10-22-2015 100 140 df2 date df2price1 df2price2 10-20-2015 110 140 10-21

XSLT Document() Function results in Saxon Error/ Attribute-String cant be used as Filepath

可紊 提交于 2019-12-24 11:36:09
问题 Basic Information is I have a Element with an ID I want to use the ID-Attribute within the document()-Function to extract the content of the -element I have two Problems here: 1) my saxon Processor wont resolve any fixed! Filepath I provide within de Document Function -->RESULT: FODC0005 Document has been marked not available: Filepath Question: Why ??? This is my code so far: <xsl:template match="pmentry"><xsl:apply-templates/></xsl:template> <xsl:template match="refdm"><xsl:apply-templates/

Gulp Concat JS results in require is not defined

两盒软妹~` 提交于 2019-12-24 00:46:04
问题 I have project using gulp. I am trying to get jquery, jquery ui and bootstrap into one file called vendor.js. This works fine however when I run "gulp serve" to run the project fromthe dist folder of the project i get the error ReferenceError: require is not defined http://localhost:3000/assets/toolkit/scripts/vendor.js Line 6 var jQuery = require('jquery'); gulp.task('vendor-js', function() { return gulp.src(['src/assets/toolkit/scripts/vendor/jquery.min.js', 'src/assets/toolkit/scripts

Can't apply concat function in WSO2 ESB CONFIGURATION with json-eval

谁说我不能喝 提交于 2019-12-23 23:17:39
问题 I'm trying to set this expression in order to obtain the output file name as a concat between the name of the city and the extention of the file: <?xml version="1.0" encoding="UTF-8"?> <sequence name="WriteFile_City" xmlns="http://ws.apache.org/ns/synapse"> <property expression="concat(json-eval($.city.name),'.xml')" name="transport.vfs.ReplyFileName" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/> <property name="OUT_ONLY" value="true"/> <send> <endpoint> <address

Concat String by Group

耗尽温柔 提交于 2019-12-23 12:36:26
问题 In my query I want to combine same item into a String group by _id here is my document "_id" : ObjectId("59e955e633d64c81875bfd2f"), "tag_id" : 1, "client_id" : "10001" "_id" : ObjectId("59e955e633d64c81875bfd30"), "tag_id" : 1, "client_id" : "10002" I hope the output would be "_id" : 1 "client_id" : "10001,10002" 回答1: You can do it with the aggregation framework as a "two step" operation. Which is to first accumulate the items to an array via $push withing a $group pipeline, and then to use

mySQL >> Adding HREF links to a Distinct GROUP_CONCAT

戏子无情 提交于 2019-12-23 05:25:13
问题 I have the following query: SELECT *, RES.res_id 'ID', RES.RES_Title 'Title', GROUP_CONCAT(DISTINCT T.T_Name separator ', ') 'Topics', GROUP_CONCAT(DISTINCT CH.CH_Code separator ', ') 'Chapters' FROM Resources RES LEFT JOIN topic_to_resource RT ON RT.RT_ResourceID = RES.RES_ID LEFT JOIN topics T on T.T_ID = RT.RT_TopicID LEFT JOIN topic_to_chapter TCH on TCH.TCH_TopicID = T.T_ID LEFT JOIN chapters CH ON CH.CH_ID = TCH.TCH_FrameworkID WHERE RES_Status = 'Active' GROUP BY RES.RES_ID ORDER BY

MySQL: Nested GROUP_CONCAT

只愿长相守 提交于 2019-12-23 03:24:11
问题 I'm receiving an "Invalid use of group function" error when executing this SELECT statement. SELECT kits.id, kits.is_quote, GROUP_CONCAT( CONCAT_WS('|||', kits_table.id, kits_table.name, GROUP_CONCAT( CONCAT_WS('|', parts_table.id, parts_table.name) SEPARATOR '||'), GROUP_CONCAT( CONCAT_WS('|', labor_table.id, labor_table.description) SEPARATOR '||') ) SEPARATOR '||||') as kits, GROUP_CONCAT(CONCAT_WS('|', parts.id, parts.name) SEPARATOR '|||') as parts, GROUP_CONCAT(CONCAT_WS('|', labor.id,

PHP/mySQL - using result from 'CONCAT' and 'AS' in 'LIKE' clause

喜夏-厌秋 提交于 2019-12-23 02:31:18
问题 Hi I have the following code; if( ! empty( $post['search-bar'] ) ) { $search_data = preg_replace("#\s\s#is", '', preg_replace("#[^\w\d\s+]#is", '', $post['search-bar'] ) ); $data_array = explode( " ", $search_data ); $data_array = "'%" . implode( "%' OR '%", $data_array ) . "%'"; $query = " SELECT CONCAT( PROFILE_PROFFESION, FIRST_NAME, LAST_NAME, DISPLAY_NAME) AS 'STRING' FROM `" . ACCOUNT_TABLE . "` WHERE STRING LIKE ( " . $data_array . " ) AND BUSINESS_POST_CODE LIKE '" . substr(P_BUSINESS