Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • Last Modified:

SQL Statement

I'd like to do a sql (MySQL) query where I can compare one numeric field with the sum of 5 other numeric fields.

Specifically, like:

SELECT * from table where table.a + table.b + table.c + table.d + table.e <> table.f

Can this be done & what is the right syntax?

Richard Korts
Richard Korts
1 Solution
Like this?

SELECT * from table where (table.a + table.b + table.c + table.d + table.e) <> table.f

Open in new window


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now