Format SQL Table data as Text Table(将 SQL 表数据格式化为文本表)
问题描述
我从 Oracle 数据库得到如下结果:
I have a result from Oracle database as below:
1 Chi Phí Lương FA_Phan_Bo_Chi_Phi_Luong 8 JOHN 8 2015 (BLOB) FA_Phan_Bo_Chi_Phi_Luong_Final.csv 09-NOV-15 Đã Hoàn Thành
2 Tổng Hợp TimeSheet Nhân Viên FA_Tong_Hop_Timesheet 8 JOHN 8 2015 (BLOB) FA_Tong_Hop_Timesheet_COM_Final.csv 09-NOV-15 Đã Hoàn Thành
3 Tổng Hợp Doanh Thu FA_Tong_Hop_Doanh_Thu 8 JOHN 8 2015 (BLOB) FA_Tong_Hop_Doanh_Thu_Final.csv 09-NOV-15 Đã Hoàn Thành
4 Chi Phí Hoạt Động Công Ty FA_CP_Hoat_Dong 8 JOHN 8 2015 (BLOB) FA_CP_Hoat_Dong_Final.csv 09-NOV-15 Đã Hoàn Thành
5 Khấu Hao Máy Móc Thiết Bị FA_CP_Khau_Hao_Phan_Bo_MMTB 8 JOHN 8 2015 (BLOB) FA_CP_Khau_Hao_Phan_Bo_MMTB_Final.csv 09-NOV-15 Đã Hoàn Thành
如何将文本格式化为具有相同列宽的表格?
How can I format text as a table with the same width of column?
推荐答案
你的文本sql结果:
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
| 1 | Chi Phí Lương | FA_Phan_Bo_Chi_Phi_Luong | 8 | JOHN | 8 | 2015 | (BLOB) | FA_Phan_Bo_Chi_Phi_Luong_Final.csv | 09-NOV-15 | Đã Hoàn Thành |
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
| 2 | Tổng Hợp TimeSheet Nhân Viên | FA_Tong_Hop_Timesheet | 8 | JOHN | 8 | 2015 | (BLOB) | FA_Tong_Hop_Timesheet_COM_Final.csv | 09-NOV-15 | Đã Hoàn Thành |
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
| 3 | Tổng Hợp Doanh Thu | FA_Tong_Hop_Doanh_Thu | 8 | JOHN | 8 | 2015 | (BLOB) | FA_Tong_Hop_Doanh_Thu_Final.csv | 09-NOV-15 | Đã Hoàn Thành |
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
| 4 | Chi Phí Hoạt Động Công Ty | FA_CP_Hoat_Dong | 8 | JOHN | 8 | 2015 | (BLOB) | FA_CP_Hoat_Dong_Final.csv | 09-NOV-15 | Đã Hoàn Thành |
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
| 5 | Khấu Hao Máy Móc Thiết Bị | FA_CP_Khau_Hao_Phan_Bo_MMTB | 8 | JOHN | 8 | 2015 | (BLOB) | FA_CP_Khau_Hao_Phan_Bo_MMTB_Final.csv | 09-NOV-15 | Đã Hoàn Thành |
+---+------------------------------+-----------------------------+---+------+---+------+--------+---------------------------------------+-----------+---------------+
您可以在 tablesgenerator 生成文本表格,如以下格式.
You can generate text tables at tablesgenerator like following formats.
您可以提供如下输入:
- 文件中的 SQL 结果 -> 粘贴表数据
- 文件 -> 导入 CSV 文件
- 或者您可以手动生成表格
您可以在此处将列值对齐到左、右、中心.
Here you can align column values to left, right, centre.
表格边框不使用 Unicode 符号
Without Using Unicode symbols for table borders
+----+-------------+--------+-------+-----+
| id | name | gender | state | age |
+----+-------------+--------+-------+-----+
| 1 | John Kenedy | male | NY | 32 |
+----+-------------+--------+-------+-----+
| 2 | Meresa Oslo | female | HI | 26 |
+----+-------------+--------+-------+-----+
| 3 | Mike Lanes | male | FL | 25 |
+----+-------------+--------+-------+-----+
对表格边框使用 Unicode 符号
Useing Unicode symbols for table borders
╔════╦═════════════╦════════╦═══════╦═════╗
║ id ║ name ║ gender ║ state ║ age ║
╠════╬═════════════╬════════╬═══════╬═════╣
║ 1 ║ John Kenedy ║ male ║ NY ║ 32 ║
╠════╬═════════════╬════════╬═══════╬═════╣
║ 2 ║ Meresa Oslo ║ female ║ HI ║ 26 ║
╠════╬═════════════╬════════╬═══════╬═════╣
║ 3 ║ Mike Lanes ║ male ║ FL ║ 25 ║
╚════╩═════════════╩════════╩═══════╩═════╝
降价表
| id | name | gender | state | age |
|----|-------------|--------|-------|-----|
| 1 | John Kenedy | male | NY | 32 |
| 2 | Meresa Oslo | female | HI | 26 |
| 3 | Mike Lanes | male | FL | 25 |
这篇关于将 SQL 表数据格式化为文本表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 SQL 表数据格式化为文本表
基础教程推荐
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01