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

x
  • 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?

Thanks
0
Richard Korts
Asked:
Richard Korts
1 Solution
 
rjohnsonjrCommented:
Like this?

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

Open in new window

0

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