跨列拆分MySql查询字符串 [英] Splitting a MySql query string across columns

查看:167
本文介绍了跨列拆分MySql查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是一名初级程序员,被赋予了在表中显示数据的任务,但是我坚持如何在多列中显示数据,我运行查询时,我得到了6列数据需要显示在其中.它将所有数据检索到第一列中,值之间用"/"分隔,是否可以在出现"/"时拆分这些值,以在其单独的列中显示这些值?

任何帮助将不胜感激

谢谢:)

Hi im a junior programmer, and been given a task to display data inside a table but im stuck on how to display the data across multiple columns, ive got 6 columns that the data needs to display in, when i run the query it retrieves all the data into the first column the values are separated by a "/" is there a way to split the values at the occurrence of the "/" to display the values in their separate columns?

any help will be appreciated greatly

thanks:)

推荐答案

是的,这很容易.
只需使用Split关键字即可.

string[] splitStart = startString.Split(''/'')会将第一列中的所有文本放入一个数组中.
Yes this is quite easy.
Just use the Split keyword.

string[] splitStart = startString.Split(''/'') will put all the text from the first column into an array.


非常感谢那个split关键字"帮助它们在多列中显示.
thanks alot that "that split keyword" helped got them to show across multiple columns


这篇关于跨列拆分MySql查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆