Page 1 of 1

MySQL SELECT statement trouble

Posted: Fri 20 Apr 2007 15:18
by Cody21
Sorry to ask such a (hopefully) stupid question. I have everything working now with the new release and am trying to create a MySql Select statement that just refuses to work. See below -- what happens is that I'm trying to extract from the Roles/Membership provider ONLY THE RECORDS thathave a ROLENAME='sub' .... The SELECT is resulting in EVERY record in the Roles/Membership database. What am I doing wrong? BTW, homephone, cellphone, etc are FIELDS I *added* to the Table.)

Thanks so much ... (PS - I *finally* had an epiphony in seeing how METHODS work !!!!! Yea ..)


SELECT firstName, lastName, Email, homePhone, cellPhone, workPhone, rolename
FROM aspnet_membership
INNER JOIN `aspnet_roles`
ON aspnet_roles.rolename = 'sub'
ORDER BY firstName

Posted: Mon 23 Apr 2007 07:37
by Alexey
The SELECT is resulting in EVERY record in the Roles/Membership database.
You mean you get even those records that has not 'sub' rolename?
Try to use WHERE clause instead of inner join and spot the difference.

Posted: Mon 23 Apr 2007 19:52
by Cody21
I got this working after a weekend of working thru the QUERY part of VS 2005 ..

Thanks Alexey !!!!

Posted: Tue 24 Apr 2007 06:49
by Alexey
Good.