My favorites | Sign in
Logo
    
New issue | Search
for
| Advanced search | Search tips
Issue 68: Patch: Allow Column to Column Comparison
2 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by JonWynveen, Apr 22, 2009
DB.Select() wouldn't allow you to compare the value of one column of a
record to another column in that record. What this patch allows you to do
is something like:

DB.Select().From<PromotionCode>()                       
.Where(PromotionCode.TotalUsedColumn).IsLessThan(PromotionCode.LimitColumn)

Normally, the IsLessThan method (and other comparison methods) just
compares the value you send in to it, but this patch checks if the value
passed in is of type TableSchema.TableColumn and if it is, it then writes
the column name to the generated SQL instead of the value passed in. The
patch should work for all comparison methods except Is, IsNot, In, NotIn,
and BetweenAnd.

Patch attached.
ColumnToColumnComparison.patch
1.4 KB   Download
Sign in to add a comment

Hosted by Google Code