为什么我的 SQL 表结果只有两行?检查下面的屏幕截图

发布于 2025-01-10 12:46:33 字数 128 浏览 0 评论 0原文

创建值并将其插入表后,当我查看结果时,我得到了两行结果。我不知道该怎么办。请帮忙。SQL 搜索结果

After creating and inserting values into my table, when I look out for the results, I get it in two lines. I don't know what to do. please help.SQL search result

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魂归处 2025-01-17 12:46:33

为了说明您在评论中已经被告知的内容。

这(或多或少)是您所拥有的:

SQL> create table employee_database
  2    (employee_name  varchar2(50),
  3     street         varchar2(30),
  4     city           varchar2(30));

Table created.

SQL> insert into employee_database values ('abc', 'bgefdc street', 'chennai');

1 row created.

SQL> select * from employee_database;

EMPLOYEE_NAME
--------------------------------------------------
STREET                         CITY
------------------------------ ------------------------------
abc
bgefdc street                  chennai

如果您格式化列(基本上,缩短列,因为它们对于当前行大小来说太长):

SQL> col employee_name format a20
SQL> col street        format a20
SQL> col city          format a20
SQL>
SQL> select * from employee_database;

EMPLOYEE_NAME        STREET               CITY
-------------------- -------------------- --------------------
abc                  bgefdc street        chennai

SQL>

或者,放大行大小(我将首先恢复列的格式):

SQL> col employee_name format a50
SQL> col street        format a30
SQL> col city          format a30
SQL> select * from employee_database;

EMPLOYEE_NAME
--------------------------------------------------
STREET                         CITY
------------------------------ ------------------------------
abc
bgefdc street                  chennai


SQL> set linesize 200
SQL> select * from employee_database;

EMPLOYEE_NAME                                      STREET                         CITY
-------------------------------------------------- ------------------------------ ------------------------------
abc                                                bgefdc street                  chennai

SQL>

To illustrate what you were already told in a comment.

This is (more or less) what you have:

SQL> create table employee_database
  2    (employee_name  varchar2(50),
  3     street         varchar2(30),
  4     city           varchar2(30));

Table created.

SQL> insert into employee_database values ('abc', 'bgefdc street', 'chennai');

1 row created.

SQL> select * from employee_database;

EMPLOYEE_NAME
--------------------------------------------------
STREET                         CITY
------------------------------ ------------------------------
abc
bgefdc street                  chennai

If you format columns (basically, shorten columns as they are too long for the current line size):

SQL> col employee_name format a20
SQL> col street        format a20
SQL> col city          format a20
SQL>
SQL> select * from employee_database;

EMPLOYEE_NAME        STREET               CITY
-------------------- -------------------- --------------------
abc                  bgefdc street        chennai

SQL>

Alternatively, enlarge line size (I'll first revert columns' formatting):

SQL> col employee_name format a50
SQL> col street        format a30
SQL> col city          format a30
SQL> select * from employee_database;

EMPLOYEE_NAME
--------------------------------------------------
STREET                         CITY
------------------------------ ------------------------------
abc
bgefdc street                  chennai


SQL> set linesize 200
SQL> select * from employee_database;

EMPLOYEE_NAME                                      STREET                         CITY
-------------------------------------------------- ------------------------------ ------------------------------
abc                                                bgefdc street                  chennai

SQL>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文