Jump to content
php.lv forumi

maza problemina


GARAIS
 Share

Recommended Posts

labdien man ir viena problema man ir draugu baze un izvelkot draugu draugus tas notiek bet dazi draugi atkartojas piemmeram tad kad diviem maniem draugiem ir kopejs draugs ka izveidot lai to id rada vienu reizi?

 

query: taads

 

 

SELECT id,friend_two_id,REPEAT(123 , 3)

FROM friends

WHERE friend_one_id IN (

SELECT friend_two_id

FROM friends

WHERE friend_one_id=3553497

)

AND

friend_two_id NOT IN (

SELECT friend_two_id

FROM friends

WHERE friend_one_id=3553497

)

AND

friend_two_id NOT IN (

SELECT friend_one_id

FROM friends

WHERE friend_one_id=3553497

) ;

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...