Note that there are some explanatory texts on larger screens.

plurals
  1. POSelect rows after a row with a certain value
    primarykey
    data
    text
    <p>Hey again, im still getting a hang of Queries and stuff so please excuse all the frequent sql questions 8)</p> <p>Anyways im trying to select rows after a certain value. Dont understand? Ok this is how it actually looks.</p> <p>Table: messages</p> <pre><code>+------------+-----------+---------+-------+---------------------------------------+----------------+------------------+ | message_id | thread_id | user_id | to_id | body | message_status | uid_sent_deleted | +------------+-----------+---------+-------+---------------------------------------+----------------+------------------+ | 1 | 1 | 1 | 7 | How are you bro? | read | 1 | | 2 | 1 | 7 | 1 | IM good what about you kenny? | read | 0 | | 3 | 1 | 1 | 7 | Same just chilling how is your sister | read | 1 | | 4 | 1 | 7 | 1 | Shes coool u know just doin great | read | 0 | | 7 | 1 | 1 | 7 | Thats nice | read | 1 | | 8 | 1 | 7 | 1 | Yupp | read | 0 | | 9 | 1 | 1 | 7 | hhahaha | read | 1 | | 10 | 1 | 7 | 1 | anyways.... | unread | 0 | +------------+-----------+---------+-------+---------------------------------------+----------------+------------------+ </code></pre> <p>Where the message id is 9, is has the value of '1' in the column uid_sent_deleted. Im trying to select rows after the last row that has a value of '1' in the column uid_sent_deleted.</p> <p>here is the sql that im currently working with. Thanks for the help!!</p> <pre><code>SELECT message_id, thread_id, messages.user_id, to_id, body, message_status, uid_sent_deleted FROM messages INNER JOIN messages_thread ON messages_thread.id = messages.thread_id WHERE thread_id =1 GROUP BY messages.message_id ORDER BY message_id ASC </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload