简体   繁体   中英

Find the ID of a MySQL row based on another field

I have a line in MySQL with information like the username and email address and I would like to find the id of the row based on the username field. Any ideas on how to find the id based on the username field?

SELECT id FROM users WHERE username = 'NStorm';

这是非常基本的sql:

select id from your_table where username = 'foo'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM