Hướng dẫn show data in table mysql - hiển thị dữ liệu trong bảng mysql
Hi everyone am fairly new to mysql, I made a java program that stores data in mysql database. I am using this tool called mysql-workbench that can create databases, tables and much more. What I wanted to do is to view all the contents of the table I just populated with data in my java program. I know that one can view all the contents of a table using some SQL scripts, however am wondering if mysql-workbench can display all the contents in the table without entering SELECT mysql script in a sort of tabular form or similar to how they display contents of table in phpMyAdmin. Show The reason why I wanted to do this is that I have 2-3k entries in that table and using a console is kind of messy. Any help or suggestions on how to do this? Thanks in advance. asked Sep 17, 2012 at 23:06
After you create a connection to your database, execute the following two commands: Then MySQL Workbench will show another pane with the results. This will be the entire contents of the table. answered Sep 17, 2012 at 23:14 psyklopzpsyklopz 2162 silver badges3 bronze badges 4 OP said: "However I was looking for a "just click and click" solution if you know what I mean. " You can also right click the table you are interested in via the schema inspector tab on the left, and select the option: "Select Rows - Limit 1,000" for a quick view,
obviously limited to 1,000 results. answered Apr 23, 2015 at 19:19 Handy MySQL Commands
Description
Command
To login (from unix shell) use -h only if needed.
[mysql dir]/bin/mysql -h hostname -u root -p
Create a database on the sql server.
create database [databasename];
List all databases on the sql server.
show databases;
Switch to a database.
use [db name];
To see all the tables in the db.
show tables;
To see database's field formats.
describe [table name];
To delete a db.
drop database [database name];
To delete a table.
drop table [table name];
Show all data in a table.
SELECT * FROM [table name];
Returns the columns and column information pertaining to the designated table.
show columns from [table name];
Show certain selected rows with the value "whatever".
SELECT * FROM [table name] WHERE [field name] = "whatever";
Show all records containing the name "Bob" AND the phone number
'3444444'.
SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';
Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.
SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;
Show all records starting with the letters 'bob' AND the phone number
'3444444'.
SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';
Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.
SELECT * FROM [table name] WHERE rec RLIKE "^a$";
Show unique records.
SELECT DISTINCT [column name] FROM [table name];
Show selected records sorted in an ascending (asc) or descending
(desc).
SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;
Count rows.
SELECT COUNT(*) FROM [table name];
Join tables on common columns.
select lookup.illustrationid, lookup.personid,person.birthday from lookup Bài Viết Liên QuanQuảng CáoCó thể bạn quan tâmToplist được quan tâm#1
Top 7 sự tích hồ gươm - ngữ văn lớp 6 20236 tháng trước#2
Top 7 gdcd 6 bài 1 kết nối tri thức 20236 tháng trước#3
Top 7 ý nghĩa của xây dựng gia đình văn hóa 20236 tháng trước#4
Top 6 mẫu hợp đồng mượn đất làm nhà xưởng 20236 tháng trước#5
Top 3 tổng tài biến thái tôi yêu anh tập 27 20236 tháng trước#6
Top 6 kết thực phim mỹ nhân vô lệ 20236 tháng trước#7
#8
Top 8 đề tài và chủ de của tác phẩm tắt đèn 20236 tháng trước#9
Top 5 tiểu sử của thầy thích pháp hòa 20236 tháng trướcQuảng cáoXem NhiềuCó xét ngành nghề khi nhập khẩu hàng hóa năm 20241 tuần trướcPhần mềm khắc phụ lỗi wifi trên an năm 20241 tuần trướcChủng chuẩn e.coli atcc 25922 là gì năm 20244 ngày trướcPhục hồi nút erase trong cs6 bị lỗi năm 202422 giờ trướcChương trình giải toán giải toán đại số năm 20244 ngày trướcHọc hỏi những điểm tốt tiếng anh là gì năm 20241 tuần trướcDì ruột bán cháu ở thường xuân thanh hóa năm 20242 ngày trướcKiến bu quần lót là hiện tượng gì năm 20241 ngày trướcBài tập hỗn hợp kim loại tác dụng với hno3 năm 20241 tuần trướcQuảng cáoChúng tôiTrợ giúpBản quyền © 2021 Học Tốt Inc.
|