Forum Moderators: coopster

Message Too Old, No Replies

Mysql select statement issue

select from two different tables

         

tabish

3:22 pm on Dec 20, 2006 (gmt 0)

10+ Year Member



Hello All,

I am using Mysql Database.

1)I have two tables named A and B
2)in Table A i have few fields like username,dob,city,country,resume,level

3) On table B I have fields like username,title,description

Now! What i want is:

I have to select username,title,description from table B and dob,city,country from Table A where username is same in two tables and title and decription should not be empty in table B and it should be order by level (from table A)

I am really stuck:(

Help me please.
Regards

Psychopsia

4:02 pm on Dec 20, 2006 (gmt 0)

10+ Year Member



SELECT a.dob, a.city, a.country, b.username, b.title, b.description
FROM table_a a, table_b b
WHERE a.username = b.username
AND b.title <> ''
AND b.description <> ''
ORDER BY a.level