各位大侠:在之前脚本中查询db2数据库时,db2 命令带x参数即可只展示要查询出来的结果。但是mysql在执行查询时 如果只展示我要的数据呢,而不是类似:
--------------
select a.xx b.xx,a.xx from tbl_xx_inf a,tbl_xx_inf b where a.xx = b.xx
--------------Empty set (0.00 sec)Bye。
--------------
select a.xx b.xx,a.xx from tbl_xx_inf a,tbl_xx_inf b where a.xx = b.xx
--------------Empty set (0.00 sec)Bye。
你是直接在mysql命令行里调用是吗,但是返回的结果有一些不相关的字符,你不需要是吗?
这样可以,加上-s参数,建议你买本书看看,书上都有C:\Users\Administrator\Desktop>cd C:\Program Files\MySQL\MySQL Server 5.6\binC:\Program Files\MySQL\MySQL Server 5.6\bin>mysql -h 192.168.100.141 -u root -pwin@channel -s
Warning: Using a password on the command line interface can be insecure.
mysql> use world;
mysql> select * from tb2;
id name
1 aa
1 bb
1 cc
1 aa
2 aa
2 bb
2 dd
2 ccmysql>