469,150 Members | 1,951 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,150 developers. It's quick & easy.

Problem with query

12
hi,

I have a drop-down box whereever a name is to be entered so that a user can select a name from that.
I have to store the userid, but display the username.
While display, i am able to display the username, but in this particular form, where i have to display the username's of two columns: responsibility and chairperson,i am unable to write the query.How can it be written?

Below ive pasted the query which displays the username for column:responsibility, i want to display the username for both the columns

rs = st.executeQuery("select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid");

Below, are the tables
Table 1: userid,username
Table 2: responsibility,chairperson


--------------------------------------------------------------------------------
May 14 '07 #1
2 1080
debasisdas
8,127 Expert 4TB
I dont think there is any relation ship between these two tables

and your query

"select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid"

may not work.

beacuse it seems responsbility and userid columns must have different data type ,then how can u match on these two fields.
May 14 '07 #2
hi,

I have a drop-down box whereever a name is to be entered so that a user can select a name from that.
I have to store the userid, but display the username.
While display, i am able to display the username, but in this particular form, where i have to display the username's of two columns: responsibility and chairperson,i am unable to write the query.How can it be written?

Below ive pasted the query which displays the username for column:responsibility, i want to display the username for both the columns

rs = st.executeQuery("select u.username,a.tobefollowedupby from table2 a,table1 u WHERE a.responsibility=u.userid");

Below, are the tables
Table 1: userid,username
Table 2: responsibility,chairperson


--------------------------------------------------------------------------------
Hi,
i hope it may work well and help u.
select u.username responsibility,b.username chairperson
from table1 u,table1 b,table2 a
where u.userid = a.responsibility
and b.userid = a.chairperson

regards,
gangadhar
May 16 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by Development - multi.art.studio | last post: by
3 posts views Thread by Juan Antonio Villa | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.