tags:

views:

50

answers:

1
SELECT * FROM sometable where a=1 and (a=2 or (b=1 and c=2))

How can I build a query I need? (no inlinequery)

+1  A: 
DB.Select().From(sometable.Schema)    
  .Where(sometable.a).IsEqualTo(1)  
  .AndExpression(sometable.a).IsEqualTo(2)  
  .OrExpression(sometable.b).IsEqualTo(1)  
  .And(sometable.c).IsEqualTo(2);
Adam
your query result is SELECT * FROM sometable where a=1 and (a=2 ) or (b=1 and c=2)so it's not the right answer
legio
You should upgrade to SubSonic 2.2
Adam
thx,and i have download it, read the release notes, i want to know more diffs from 2.1 ,can you help me?
legio
You can have a look at the release page to see what's changed http://blog.wekeroad.com/subsonic/subsonic-22-released/
Adam