>> I want to know what are the customers having missing month data based on the following data pattern. My data is present in table in below format. Please help me to form a SQL query to find out how we can get missing month flag value. <<
In SQL, unlike a spreadsheet, data is represented in tables. What you posted is a display spreadsheet. It also happens to have the wrong format for dates. Please read the part about posting DDL you want help. You'll find out very quickly that you need a good working DDL and that most of the problems come from bad DDL. Also, flags are assembly language, not SQL.
For example, it would really help if we knew what your data was. We don't even know the name of your table! Your unit of measure seems to be a month according to your narrative. But you display only vague dates not associated with any year. I'm going to make a suggestion that you use the MySQL convention four months. It is based on ISO- 8601 standards used in SQL, but it is not yet official. The format is "yyyy-mm-00" and you'll have to use the string for where the double zeroes replace what would've been the day with in month.
CREATE TABLE Foobar
(customer_name CHAR(10) NOT NULL,
posting_month CHAR(10) NOT NULL
CHECK (posting_month LIKE '[0-9][0-9][0-9]-[0-1][0-9]-00)',
PRIMARY KEY (customer_name, posting_month),
foo_cnt INTEGER CHECK (foo_cnt >0)
Following your design, I will assume that every month that we consider, but has not counted its foos yet defaults to a NULL.
WHERE posting_month BETWEEN @start_month AND @end_month
GROUP BY customer_name
HAVING COUNT(*) > COUNT(customer_name)'
Please post DDL and follow ANSI/ISO standards when asking for help.