Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Export data from MS SQL server 2005

Author  Topic 

Ragabash
Starting Member

6 Posts

Posted - 2008-01-17 : 07:45:30
I'm new in SQL. I must write query that finds a specific data.
you have two tables one is the user table the other is the role table.
In the user table, there is someone who called "Alfred" and his role is saved in the role_name field in role table. Ultimately, I must find "Alfred's role". I will thank to anyone who gives me a hand.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-17 : 07:52:01
Select u.user_name,r.role from users u inner join roles r on u.userid=r.roleid

Also Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -