Home > Database > Oracle > body text

How to write not equal to a certain value in Oracle

下次还敢
Release: 2024-05-08 18:48:15
Original
446 people have browsed it

The syntax in Oracle to indicate that it is not equal to a certain value is "column_name <> value". For example, to query employees whose salary is not equal to $1,000, you can use "SELECT emp_id, salary FROM employees WHERE salary < > 1000;" query.

How to write not equal to a certain value in Oracle

How to write a value that is not equal to a certain value in Oracle

In Oracle, you can use the "NOT" operator to indicate that it is not equal to a certain value. The specific syntax is as follows:

<code class="SQL">column_name <> value</code>
Copy after login

Among them:

  • column_name is the column name to be compared
  • value is the column name to be compared Comparative values

Example:

Suppose there is a table named "employees", which contains "emp_id" and "salary" columns. To query for employees whose salary is not equal to $1000, you can use the following query:

<code class="SQL">SELECT emp_id, salary
FROM employees
WHERE salary <> 1000;</code>
Copy after login

This query will return all rows with emp_id and salary columns where the salary column is not equal to $1000.

The above is the detailed content of How to write not equal to a certain value in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!