MySQL字串連線

智慧先行者發表於2015-07-20

mysql> select concat('Hadoop:','Hive:','Spark#','HBase;',TBL_TYPE,'{}',SD_ID) from TBLS;

| Hadoop:Hive:Spark#HBase;MANAGED_TABLE{}6                        |

| Hadoop:Hive:Spark#HBase;MANAGED_TABLE{}7                        |

| Hadoop:Hive:Spark#HBase;MANAGED_TABLE{}12                       |

 

 

mysql> select concat_ws(':','Hadoop','Hive','Spark','HBase',TBL_TYPE,SD_ID) from TBLS;

| Hadoop:Hive:Spark:HBase:MANAGED_TABLE:6                       |

| Hadoop:Hive:Spark:HBase:MANAGED_TABLE:7                       |

| Hadoop:Hive:Spark:HBase:MANAGED_TABLE:12                      |

 

相關文章