Lijoyx Posted July 29, 2008 Share Posted July 29, 2008 hai folks, i have a table and i update data everyday. now i want to take the product which is new.(ie product entered in the max date - date entered in the last day(say 2008-07-20) SELECT * FROM all_product_details WHERE Product_Id NOT IN ( SELECT Product_Id FROM all_product_details WHERE Date_Of_Feed = 2008 -07 -20 ) AND Date_Of_Feed = ( SELECT MAX( Date_Of_Feed ) FROM all_product_details ) now what is wrong with this code. it doesn't show any error but its not showing the results. Quote Link to comment Share on other sites More sharing options...
Lijoyx Posted July 29, 2008 Author Share Posted July 29, 2008 SELECT * FROM all_product_details WHERE Product_Id NOT IN ( SELECT Product_Id FROM all_product_details WHERE Date_Of_Feed = '2008-07-20' ) AND Date_Of_Feed = ( SELECT MAX( Date_Of_Feed ) FROM all_product_details ) LIMIT 1 this code too is not working Quote Link to comment Share on other sites More sharing options...
fenway Posted July 31, 2008 Share Posted July 31, 2008 What error do you get? Quote Link to comment Share on other sites More sharing options...
Lijoyx Posted August 4, 2008 Author Share Posted August 4, 2008 there was no error but it takes ages. but its all correct now i created an index in the date field now the execution is super fast. thank you all Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.