Create a views "exposed filter" to compare two fields
Solution 1

Make use of views php to do the compare with the help of https://www.drupal.org/project/views_php

In that case you have to write some code which is executed on each row, in the end it will work but it is very bad in maintaining. You do not have any integrated editor for error code checking etc etc. It is a solution but I do not recommend it.

Solution 2

Make use of the hook views_post_execute with parameter of the view name.

function YOURMODULENAME_views_post_execute(&amp;$view){

For easy maintenance start with a switch

switch ($view-&gt;name){

    case "YOURVIEWNAMEA";
    case "YOURVIEWNAMEB";
    case "YOURCASEVIEW";

    foreach ($view-&gt;result as $row =&gt; $rowinfo) {


      // put here your code to do something with each result.

       // E.G Delete a value in the result of the view making use of unset statement 
        unset ($view-&gt;result[$row]);


      }