title: Cassandra Order by currently only support the ordering of columns following their declared order in the PRIMARY KEY
body: <p>This is the query I used to create the table:</p>
  
  <pre><code>CREATE TABLE test.comments (msguuid timeuuid, page text, userid text, username text, msg text, timestamp int, PRIMARY KEY (timestamp, msguuid));
  </code></pre>
  
  <p>then I create a materialized view:</p>
  
  <pre><code>CREATE MATERIALIZED VIEW test.comments_by_page AS
      SELECT *
      FROM test.comments
      WHERE page IS NOT NULL AND msguuid IS NOT NULL
      PRIMARY KEY (page, timestamp, msguuid)
      WITH CLUSTERING ORDER BY (msguuid DESC);
  </code></pre>
  
  <p>I want to get the last 50 rows sorted by timestamp in ascending order.</p>
  
  <p>This is the query I'm trying:</p>
  
  <p><code>SELECT * FROM test.comments_by_page WHERE page = 'test' AND timestamp &lt; 1496707057 ORDER BY timestamp ASC LIMIT 50;</code></p>
  
  <p>which then gives this error: <code>InvalidRequest: code=2200 [Invalid query] message="Order by currently only support the ordering of columns following their declared order in the PRIMARY KEY"</code></p>
  
  <p>How can I accomplish this?</p>