Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 fetch results using My Sql

Author  Topic 

vedjha
Posting Yak Master

228 Posts

Posted - 2009-02-03 : 05:40:19

I have fetched all results using SQL 2005 by CTE as Common Table Expression. Now i am using My- Sql which not supports CTE

i have to fetch Upline_ID.

select upline_id as aid ,advisor_id as isid ,1 as level from members
where advisor_id=50010001 and placement='L'

suppose result:

aid isid
2 1

now query is:

select upline_id as aid ,advisor_id as isid ,1 as level from members
where advisor_id=2

then Result:

aid isid
4 2
5 2

now query is:

select upline_id as aid ,advisor_id as isid ,1 as level from members
where advisor_id=4

and

select upline_id as aid ,advisor_id as isid ,1 as level from members
where advisor_id=5


is there any way to fetch data by a single query
Database is: My SQL



Ved Prakash Jha

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-02-03 : 05:42:08
dont Post duplicates
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-02-03 : 05:42:40
thsi forums related to sql forums
try to post in www.dbforums.com
Go to Top of Page

vedjha
Posting Yak Master

228 Posts

Posted - 2009-02-03 : 05:42:59
as i were say It is very Important for me

Ved Prakash Jha
Go to Top of Page

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2009-02-03 : 05:51:29
very important that you get an answer from this forum particularly? a forum that is NOT for MySQL? why not just post your qustion on a MySQL site?

Em
Go to Top of Page
   

- Advertisement -