Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in SQL by (6.1k points)
edited by

The title is my question. I googled and try something like

mysql> !\ clear
mysql> !\ cls
mysql> system cls
mysql? system clear

but none of them works. Can anybody guide me on how to clear the screen, just like the cls command in the window

4 Answers

0 votes
by (12.7k points)

Just scroll down with your mouse

In Linux, Ctrl+L will do but if your scroll up you will see the old commands

So I would suggest scrolling down in windows using the mouse.

If you want to learn more about SQL, Check out this SQL Certification by Intellipaat.

For more information visit:

0 votes
by (37.3k points)

You may just press {Ctrl + L} to clean the screen in the MySQL console on Windows. The cursor will go to the top, and the screen will clear as a result.

You may always exit and reopen the MySQL console to start over if that doesn't work. Regretfully, MySQL does not have a direct command similar to Command Prompt's `cls` to clear the screen.

0 votes
by (37.3k points)

To fetch the top 10 rows of a database, you can use the following query:. 

Query: 

SELECT * FROM ( 

  SELECT DISTINCT  

  APP_ID,  

  NAME,  

  STORAGE_GB,  

  HISTORY_CREATED,  

  TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') AS HISTORY_DATE   

  FROM HISTORY WHERE  

    STORAGE_GB IS NOT NULL AND  

      APP_ID NOT IN (SELECT APP_ID FROM HISTORY WHERE TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') ='06.02.2009') 

  ORDER BY STORAGE_GB DESC) 

WHERE ROWNUM <= 10 

 

0 votes
by (1.9k points)

To solve this problem in MySQL console screen in Windows

system cls;

Steps: 

Open your MySQL console.

Type the command above then hit Enter.

This should solve the problem clear the screen.

If this doesn't work for you then you can try the following commands

Ctrl + L: This will clear the screen in a few client environments for MySQL.

Close the MySQL console and reopen: Not so great, but will clear the screen

Related questions

0 votes
1 answer
0 votes
1 answer
asked Dec 30, 2020 in SQL by Appu (6.1k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...