SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 fetch results using My Sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vedjha
Posting Yak Master

India
225 Posts

Posted - 02/03/2009 :  05:40:19  Show Profile  Visit vedjha's Homepage  Reply with Quote

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

India
600 Posts

Posted - 02/03/2009 :  05:42:08  Show Profile  Reply with Quote
dont Post duplicates
Go to Top of Page

bklr
Flowing Fount of Yak Knowledge

India
1693 Posts

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

vedjha
Posting Yak Master

India
225 Posts

Posted - 02/03/2009 :  05:42:59  Show Profile  Visit vedjha's Homepage  Reply with Quote
as i were say It is very Important for me

Ved Prakash Jha
Go to Top of Page

elancaster
A very urgent SQL Yakette

United Kingdom
1208 Posts

Posted - 02/03/2009 :  05:51:29  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000