Select DISTINCT t1.* from table as t1
join table as t2 on t1.col1 = t2.col2 and t1.col2 = t2.col1 and t1.col1="text1"
var app = angular.module('foo', []);
app.controller('userCtrl', function ($scope) {
$scope.one = 10;
$scope.two = 10;
$scope.$watch('one', function(newValue, oldValue) {
summa();
});
$scope.$watch('two', function(newValue, oldValue) {
summa();
});
function summa(){
$scope.sum = parseInt($scope.one) + parseInt($scope.two);
}
});