MySQL SELECT statement trouble

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

MySQL SELECT statement trouble

Post by Cody21 » Fri 20 Apr 2007 15:18

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

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 23 Apr 2007 07:37

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.

Cody21
Posts: 112
Joined: Thu 01 Mar 2007 00:58

Post by Cody21 » Mon 23 Apr 2007 19:52

I got this working after a weekend of working thru the QUERY part of VS 2005 ..

Thanks Alexey !!!!

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 24 Apr 2007 06:49

Good.

Post Reply