Jump to content

Recommended Posts

I have this sql query:

Select 
mos_users.username, 
mos_sb_messages_text.message, 
mos_sb_messages.parent, 
mos_sb_messages.subject, 
mos_sb_messages.time, 
mos_sb_messages.ip

from 
mos_sb_messages, 
mos_users, 
mos_sb_messages_text

where
mos_sb_messages_text.mesid = mos_sb_messages.id and
mos_sb_messages.userid = mos_users.id and
mos_sb_messages.parent != 0

 

I want to use the parent field to do a join. I want to join parents to fields that have parents. So it would display parent subject and message in same row with subs.

 

I had hard time trying to explain what I want to do, I hope everybody understands what I try to achieve.

Link to comment
https://forums.phpfreaks.com/topic/195988-self-join/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.