MySQL Table Query method:Inquire:1. Simple querySELECT * FROM Info--Check all dataSelect Code,name from Info--check the data for the specified columnSelect Code as ' code name ', name as ' from Info '--Assign alias to column2. Conditional
SELECT * from EMP where deptno=30;--1 selects all employees in department 30.Select Ename,job,empno,deptno from emp where job= ' clerk ';--2 lists the name, employee number, and department number of all clerks (clerk).Select Ename, Sal,comm from EMP
Basic syntax for the SELECT statement: Select selection_list//What columns to query for from data table name//Specified data tablewhere primary_constraint//queries need to meet the criteria that the row must meetgroup by Grouping_columns//How to
Clear ScreenHost CLS;View Current UserShow user;Tables under the current userSELECT * from tab;tab data DictionaryDESC EMP;Find information for all employeesSELECT * from EMP;Querying by Column nameSelect Empno,ename,job,sal from EMP;Query employee
Operational sequencingFromOnJoinwhereGROUP BYWith cube or with rollup notHavingSelectDistinctORDER BYTopSelect *from ... Querying all dataA convenient process for filtering dataStart position from =c# foreach where filter condition =foreach{loop
1 --Query All Columns select * from Tab_name|view_name;2 SELECT * fromEMP;3 SELECT * from(SELECT * fromEMP);4 --Querying specific Columns5 SELECT * fromEmpWHEREEmp.ename='SMITH';6 --Note PL/SQL developer does not support session control
1. Query all ColumnsSELECT * from table name;2. Query table structureDESC table name;3. Query the specified columnSelect Ename,sal,job from table name;4. View all tables and fields in OracleGet table:Select table_name from User_tables; The current
first, the grammatical structureSelect select_list []from table_source[ ] [ ][][]The main parameters in the Select query statement are described belowselect_list: A comma-delimited list of columns or expressions that are queried.New_table: The new
Basic query:
View plain
-- Query Information of all employees
Select * from emp;
-- Set the row width
Set linesize 120;
-- Set the column width to the width of four digits
Col empno for 9999;
-- Set the column width. a indicates the string
Tutorial 18: Table connection Query
The purpose of this experiment is to master basic joint queries.
Table join
To obtain information from multiple tables, we can join the tables for query under certain conditions.
Related reading:
Basic query
Application of basic query for MySQL notes
Reference Table: student
Multi-field queryMysql> select id, name, birth from student;Query all fieldsMysql> select * from student;Where specified queryMysql & gt; select * from student where id = 901;Mysql>
We install the display requirements:We can see that the displayed directory contains: The name of the supplier (this data comes from the supplier's Table [Usergys]), the serial number, the generic name, the dosage form (these are all from the drug
HQL First Class:Hibernate query Language:hibernate querying language Grammar:QueryString hql= "from dept";Query query=session.createquery (HQL);//Return list collectionQuery is a list collectionHQL statement Next note detailed, this production
Linq Learning (III)-basic query and linq learning Query
I. Main introduction
Learn from the perspective of comparison between linq, SQL, and lambda.
Usage of select, orderby, paging, group by, distinct, subquery, and in
1. select
Query users and
Basic query optimization and subquery Optimization in Oracle databases
1. Reasonably sort query Conditions
Oracle uses the bottom-up sequence to parse WHERE data. From the perspective of performance optimization, we recommend that you write the
Grant all on * * to ' root ' @ ' localhost ' identified by PASSWORD ' *6bb4837eb74329105ee4568dda7dc67ed2ca2ad9 ' with GRANT OPT ION; unblock revoke all on * * from ' root ' @ '% '; flush privileges; Delete database drop library name; Modify
1. Conditionsusing the WHERE clause to filter the data in a table, the rows with the result of true appear in the result set, with the following syntax:select * FROM table name where condition;Example: SELECT * FROM students where id = 1;The where
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.