Home > database >  Query all the value of a field, recurring to keep only one. How do you write SQL statement
Query all the value of a field, recurring to keep only one. How do you write SQL statement

Time:09-17

Query all the value of a field, recurring to keep only one, how to write SQL statements
The results of the query, for example, to query field department contains the sales department, technical department, ministry of personnel, and in the sales department, so how to write SQL statements, all departments are displayed, but do not repeat again?

CodePudding user response:

The oracle database?

Add a distinct

Select distinct column 1, column 2, column 3 from the table where...

CodePudding user response:

Select distinct department from c_department;

Can be

CodePudding user response:

refer to the second floor lzp_lrp response:
select distinct department from c_department;

Can

+ 1

CodePudding user response:

refer to the second floor lzp_lrp response:
select distinct department from c_department;

Can


+ 1

The role of the DISTINCT function

CodePudding user response:

The upstairs DouZhengXie suggested that the average cent cent...

CodePudding user response:

Select distinct department from c_department;

CodePudding user response:

reference smilysoft reply: 3/f
Quote: refer to the second floor lzp_lrp response:

Select distinct department from c_department;

Can

+ 1

+ 1

CodePudding user response:

refer to 7th floor a78782295 response:
Quote: reference smilysoft reply: 3/f

Quote: refer to the second floor lzp_lrp response:

Select distinct department from c_department;

Can

+ 1

+ 1


Add too little
all you?+ 10086

CodePudding user response:

Select distinct department from table where1=1
  • Related