Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

mysql - SQL filtering by multiple columns -


i have mysql table, want query rows in pairs of columns in specific set. example, table looks this:

id | f1  | f2 -------------     1  | 'a' | 20 2  | 'b' | 20 3  | 'a' | 30 4  | 'b' | 20 5  | 'c' | 20 

now, wish extract rows in pair (f1, f2) either ('a',30) or ('b', 20), namely rows 2,3,4. wish using 'in' style filter, may have many pairs fetch. if try like:

select * my_table f1 in ('a','b') , f2 in (30, 20)

i cartesian product of values specified f1 , f2 in in clauses, i.e. rows possible combinations f1 = 'a' or 'b', , f2 = 30, 20, hence row 1 selected.

in short, i'm need like:

select * my_table (f1,f2) in (('a',30), ('b',20))

only valid sql syntax :-)

any ideas?

that is valid syntax.

if don't other alternatives are:

select * my_table (f1, f2) = ('a', 30) or    (f1, f2) = ('b', 20) 

or using join:

select * my_table t1 (     select 'a' f1, 30 f2     union     select 'b', 20 ) t2 on t1.f1 = t2.f1 , t1.f2 = t2.f2 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -