coder9 Posted July 30, 2008 Share Posted July 30, 2008 ok let say i have a table -> user which has a primary index: id and an index: username the table looks like this. ------------------------ id | user_name ------------------------ 1 | Linda 2 | michael 3 | michael 4 | Linda 5 | joseph 6 | karen 7 | Linda 8 | joseph 9 | karen i just want to count how many linda name under user_name field is this correct? SELECT count(*) FROM user WHERE user_name='Linda' Thank you. Quote Link to comment Share on other sites More sharing options...
unkwntech Posted July 30, 2008 Share Posted July 30, 2008 Yes this is correct however if this table is being used for logins then the username field should be unique or you'll have login problems Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.