Ad
  • Default User Avatar

    I would write here reply on your old question, just to make a note on my understanding of join statement work.

    Databases are usually working with various data having certain characteristics based on which data could be filtered or sorted.
    If you have two independent sets of data you have to allign certain elements from one set with certain elements from another set.

    I.e. you do something like: for each element from set 1 find elements in set 2.

    In your particular case your request is: For each element in table posts find 2 elements in table categories where id's are equal.

    we took first post, take it category and search for it in table categories, obviouisly your limit statement does not make any sence as soon as for each element form posts table always exists only one record in categories ...