How do I get this mysql query to include null values? -


I am writing a sorting script, to remove content from my site that was uploaded a week ago, and 0 or 1

  • Daily_hats - which stores the item ID, date and the number of hits that the item receives on that date
  • Video - actual Stores the content

I came with it.

  $ last_week_date = date ('ym-d', $ now- (60 * 60 * 24 * 7)); $ Last_week_timestamp = $ now- (60 * 60 * 24 * 7);  

sql

  SELECT vid_id, COALESCE (amount_heat), 0) Add daily_high to video_id = hit_imit as a total_harning from the video (hit_date) ; = '$ Last_week_date') and vid_posttime & lt; = '$ Last_week_timestamp' hit_itemid by group Total_ights total & lt; 2  

It produces items that have reached once a week ... but not all of them that have not been used at all. If an item was not used in the past week, there will be no entry in the daily_hat table. I thought coal should take care of it, but it did not work.

How can I fix this?

Overall_hats & lt; 2 or total_heets are empty

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -