Codeasearch.com - Search your code with us Login | Register | Contact us
  Forums > MySql > Need in sql statement in mysql
benaya
Posted on Jan 28, 2008
Join Date: June 2007
Location: India ( Chennai )
Posts: 90
 
Need in sql statement in mysql  

Hi,
I am want on sql statement for my table. I am having one table call friends in that table i will store userid and friendid like this.....


iUserID iFriendID
1 3
1 2
1 4
2 4
3 6
6 2
5 7
7 8

How can i get parent and child record suppose my id is 3 i have to get userid "3"'s parent records and child record. How can i get this all records....

1 3
1 2
1 4
2 4
3 6
6 2

Thanks in advance

 Hot Discussion
Go Tech launches Android tablet for Rs 3,999...
Sony targets retailers with quick sales pitches and rew...
Share and discover new activities with Google Schemer...
Samsung gets 9 mn preorders for Galaxy S3: Report...
Google revamps search engine to think like a person...
 
 Discussion Topics
IT News
Php
Javascript
Technology Updates
Asp.Net
MySql
Ajax
Html
Fedora
Software Testing
Asp
Java
General
Flash
Ruby on Rails