I have the following tables:

members:
----------------------------------------------
| member_id | member_name | member_join_date |
----------------------------------------------  

events:
-------------------------
| event_id | event_name |
-------------------------

event_dates:
--------------------------------------
| event_id | event_date | event_week |
--------------------------------------

attendance:
------------------------------------------------------------
| member_id | event_id | attendance_date | attendance_week |
------------------------------------------------------------


So I have members who joined the organization at a certain time and they may attend weekly events (the occurrences of which are monitored by the event_dates table)

What I want to do is get all members that have at least 3-consecutive absences

I did all I could and I think I have each part of the query but don't know how to merge them together.

Get all events that they could've attended:

    SELECT
      m.member_id AS id,
      ed.event_id,
      ed.event_week
    FROM
      members AS m
      LEFT JOIN
        event_dates AS ed
        ON
          ed.event_date &gt;= m.member_join_date


Get all the events they actually attended:

    SELECT
      m.member_id AS id,
      a.event_id
    FROM
      members AS m
      LEFT JOIN
        attendance AS a
        ON
          a.member_id = m.member_id


And probably the answer to this question if I manage to merge the two queries into one:

http://stackoverflow.com/questions/1321670/count-of-consecutive-not-null-values

But this time I want to count NULL values


Question: Access PDF files from 'res/raw' or assets folder programmatically to parse with given methods
Answer: After many many hours and quite a few cigarette breaks here is the solution. Once the readToByteBuffer has returned a ByteBuffer it is as easy as creating a new PDFFile that takes in a ByteBuffer.

Enjoy...

ShowPDF button Listener...

OnClickListener ShowPdfListener = new OnClickListener() {
    public void onClick(View v)
    {
        Intent intent = new Intent(PdfFileSelectActivity.this,
        PdfViewerActivity.class);
        startActivity(intent);
    }
};


In onCreate() PdfViewerActivity...

openFile2(readToByteBuffer(this.getAssets().open("test.pdf")), null);


edited readToByteBuffer() from here

public ByteBuffer readToByteBuffer(InputStream inStream) throws IOException
{
    long startTime = System.currentTimeMillis();
    BufferedReader in = new BufferedReader(new InputStreamReader(this.getAssets().open("test.pdf")));
    StringBuilder total = new StringBuilder();
    String line;
    while ((line = in.readLine()) != null) {
        total.append(line);
    }

    int length = total.length();
    byte[] buffer = new byte[length];
    ByteArrayOutputStream outStream = new ByteArrayOutputStream(length);
    int read;
    while (true) {
      read = inStream.read(buffer);
      if (read == -1)
        break;
      outStream.write(buffer, 0, read);
    }
    ByteBuffer byteData = ByteBuffer.wrap(outStream.toByteArray());
    long stopTime = System.currentTimeMillis();
    mGraphView.fileMillis = stopTime-startTime;
    return byteData;
  }