» Home » condition » Page 1
Restrictions.Disjunction() between condition a AND condition b OR condition c AND condition d
by Djuxy in Development Tools & Services

How can I create a disjunction in NHibernate that would accomplish the following sql:


Select * from MyTable
Where (conditionA = true AND conditionB = true)
OR (conditionC = true AND conditionD = true)


From what I've seen, the Disjuntion() takes single criterions and "ORs" them together. Is it possible to group to criterion together and "OR" it against anothe


How to write hive regex to match condition 1 OR condition 2 and return whichever matches?
by ShiggityShaw in Programming Languages

I need to have "or" logic in my regexp.


For example, from "foobar435" I would need the three numbers, so "435"
But from "barfoo543" I would need the three letters before the three numbers, so "foo"

Individually, the regexes would be "foobar([0-9]){3}" to get the first case, and "[a-zA-Z]{3}([0-9]{3})[a-zA-Z]{3}" to get the second case. How do I get both cases at once with


In Perl, I need to read a .conf file that contains condition like $a>$b based on the result of the condition i have to execute either if or else bl
by kodeninja in Programming Languages

The content of condition.conf:


condition1=$a>$b

Example Perl code:


$cnd_ConfFile = $ARGV[0];
open(CONDITIONS, '<', $cndConfFile);
$cndCount=0;
while ( <CONDITIONS> ) {
chomp; # no newline
s/#.*//; # no comments
s/^s+//; # no leading white
s/s+$//; # no t

In hibernate using CriteriaBuilder how to add condition to left join immediately and not as part of where condition?
by Gerle in Programming Languages

I want criteriabuilder to put AND condition immediately with join (1st left join in below query).
But When I put condition in predicate it adds if to final where clause.


I want output like this:


select
*
from
milestone milestone0_
left outer join
disc_user_milestone_watch userswatch1_
Magento Shopping Cart Rule Condition - Custom condition quote id
by shortylickens in Programming Languages

I want dynammically create a shopping cart rule to apply to particular quote id.


Any suggestion to do that?


Fast way to find a intersection between two sets of numbers, one defined by a bitwise condition and another by an arithmetic condition
by Andrew in Coding

This is probably well covered ground, but I'm ignorant on the subject so I'll be using amateurish terminology. Let's say I'm messing around with some set of conditions that each define a non-zero set of numbers within an int, let's just say 8-bit int. So for a bitwise one, I may have this:


11XX00XX

Saying that I want all bytes that have 1s where there are 1


Custom search query : edismax(user_entered_search_keywords) AND (condition A OR condition B)
by DeeJay1 in Coding

My edismax is running perfect and it handles the query formation internally when i just pass the search keywords to dismax.


The next step of my implementation is a custom query where let dismax do all the mumbo jumbo on those search keywords, but AND the dismax query with a custom condition.


When I was not using dismax, i use to create my own queries manually e.g. (keywo


NHibernate with IQueryOver - create where-condition with subquery and or condition
by André Rocheleau in Coding

When I do


Acc accountAlias = null;
var subQuery = QueryOver.Of<Temp>()
.Where(x=>x.IsAccepted==null)
.And(x=>x.Account.Id==accountAlias.Id);
var results = session.QueryOver<Acc>(()=>accountAlias)
.Where(x=>x.User.Id==65)
.WithSubquery.WhereExists(subQuery);

Select row matching a condition if no other rows match a different condition
by clifton anderson in Databases

Very basic, but didn't know what this type of query is called...I want a query that will basically do this (pseudo-SQL):


SELECT name
FROM Table
WHERE activity_status != 'active'
AND there are no rows with that same name where activity_status = 'active'

(in other words, return names of the inactive only when not one with that name i


How to write Zend db select with OR condition inside AND condition
by Paul McKee in Programming Languages

Can someone guide me to write a query like below using Zend db select :


SELECT `tbl_md_users`.*
FROM `tbl_md_users`
WHERE
user_type <> 'TYPE1')
AND (first_name LIKE '%tom%' OR last_name LIKE '%tom%' OR user_name LIKE '%tom%')

Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .