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.

what will be the simple mysql query for this -


i want customer info customer id should 2 , log_id should maximum value tried below query fetching first record found.

what simple query

mysql> select * log_customer customer_id =2 group customer_id having max(log_id); +--------+------------+-------------+---------------------+-----------+----------+ | log_id | visitor_id | customer_id | login_at            | logout_at | store_id | +--------+------------+-------------+---------------------+-----------+----------+ |      2 |         56 |           2 | 2010-02-19 19:34:45 | null      |        1 |  +--------+------------+-------------+---------------------+-----------+----------+ 1 row in set (0.00 sec)  mysql> select * log_customer customer_id =2 limit 5; +--------+------------+-------------+---------------------+---------------------+----------+ | log_id | visitor_id | customer_id | login_at            | logout_at           | store_id | +--------+------------+-------------+---------------------+---------------------+----------+ |      2 |         56 |           2 | 2010-02-19 19:34:45 | null                |        1 |  |      3 |        114 |           2 | 2010-02-23 17:31:55 | null                |        1 |  |     31 |       1854 |           2 | 2010-03-08 18:31:28 | 2010-03-08 18:56:49 |        1 |  |     32 |       1992 |           2 | 2010-03-09 01:12:43 | null                |        1 |  |     33 |       2304 |           2 | 2010-03-09 14:42:39 | null                |        1 |  +--------+------------+-------------+---------------------+---------------------+----------+ 

please not suggest order log_id desc don't want in way

     select  *        log_customer       customer_id = 2         , log_id = (select max(log_id)                         log_customer                        customer_id = 2) 

that should trick

edit without where:

     select  *        log_customer       log_id = (select max(log_id)                         log_customer                        customer_id = 2) 

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 -