'Why is my SQL table result in two lines? check the screenshot below
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
Solution 1:[1]
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>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Littlefoot |
