Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql query

Status
Not open for further replies.

prasadalone

Programmer
Aug 15, 2002
87
Following is my mssql query i want to convert this query into mssql query tell me how thank you

Select firstname +' '+lastname+' userid :'+Users.userid ,PrayerDetails,PrayerRequestDate,Paidstatus,PrayerRequest.PrayerRequestId,t1.tcnt from PrayerRequest,UserPrayerRequest,Users,(select count(*) as tcnt,PrayerRequestId from UsersReplys group by PrayerRequestId) as t1 where Users.UserId = UserPrayerRequest.Userid and UserPrayerRequest.userid <> 'aratidesai' and UserPrayerRequest.PrayerRequestId*= t1.PrayerRequestId and PrayerRequest.PrayerRequestId=UserPrayerRequest.PrayerRequestId and PrayerRequest.PrayerRequestId Not in (Select PrayerRequestId from UsersReplys where userid='aratidesai')
 
If you were to make some effort to make your query readable, you might get a better response.
 
you want to convert a microsoft SQL Server query to mysql, right?

before you do this, you must convert your query from "table list" syntax (i.e. FROM A,B,C...) to JOIN syntax (i.e. FROM A INNER JOIN B ON ...)

hint: you will need a LEFT OUTER JOIN for the relationship between UserPrayerRequest and t1

once you have finished the conversion to JOIN syntax, and tested it completely in SQL Server, then come back and show us the query

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top