如何在mysql中解决我的这个问题 [英] How to solve my this problem in mysql

查看:75
本文介绍了如何在mysql中解决我的这个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,当我投入项目时我遇到了一些问题。他们是两个表名为t1和t2。

在t1表中,这是字段DemoDate,AuthoBy和t2表字段是DateFor,OperatorName。在

这两个表AuthoBy和OperatorName就像sachin,vinod等一样。如果我在t1表中插入信息就像09:30作为DemoDate,Sachin作为AuthoBy,另一个字段9:50作为DemoDate,Vinod作为AuthoBy.Next表t2我也插入了一些数据9:36作为DateFor,Sachin作为OperatorName而另一个字段9:55作为DateFor,Sachin作为OperatorName。



桌子名称:-t1



DemoDate AuthoBy

9:30 Sachin

9:50 Vinod

10:05 Sachin



表名:-t2



DateFor OperatorName

9:36 Sachin

9:55 Sachin

10:00 Sachin

10 :06 vinod





我想回答就像



DemoDate

9:30t1

9:36t2

9:50t1

9:55t2

10:00t2

10:05t1



我从联合查询中获取值,但我想回答字段值和表名从那个表得到value.so请给我信息如何尽快解决这个问题



感谢先进!!

Dear Friend i have some problem when implimented project.Their are two tables name as t1 and t2.
In the t1 table this are fields DemoDate,AuthoBy and t2 table fields are DateFor,OperatorName.In
this two table AuthoBy And OperatorName have same just like sachin,vinod etc.If i am insert information in t1 table just like 09:30 as DemoDate, Sachin as AuthoBy,another one field 9:50 as DemoDate,Vinod as AuthoBy.Next table t2 also i inserted some data 9:36 as DateFor,Sachin as OperatorName and another one field 9:55 as DateFor,Sachin as OperatorName.

Table Name:-t1

DemoDate AuthoBy
9:30 Sachin
9:50 Vinod
10:05 Sachin

Table Name :-t2

DateFor OperatorName
9:36 Sachin
9:55 Sachin
10:00 Sachin
10:06 vinod


I want to answer just like

DemoDate
9:30t1
9:36t2
9:50t1
9:55t2
10:00t2
10:05t1

I get values from union query but i want to answer as field value and also table name from that table get value.so please give me information how to solve this problem as soon as possible

Thanks in advanced !!

推荐答案

您好,



您可以使用 MySQL CONCAT 功能添加表名。链接: MySQL CONCAT功能 [ ^ ]



如果有,请告诉我们你需要进一步的帮助。
Hi,

You can use MySQL's CONCAT function to add table name. Link: MySQL CONCAT Function[^]

Please let me know if you need further assistance.


这篇关于如何在mysql中解决我的这个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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