Urgent Help - SQL Statement..

hai everybody,

i need ur help in writing a SQL statement..

i have 2 tables say

CATEGORY

cat_idcat_name

B001IT

B002Accounts

B003Clerk

SUB CATEGORY

sub_cat_idsub_cat_namecat_id

S001 programmingB001

S002 Admin B001,B002

S003 HRB001,B002,B003

i want to display one as liek ths

sub_cat_namecat_name

ProgrammingIT

adminIT,Accounts

HRIT,Accounts,Clerk

how to write a qry for this..pl help..

thanx in advance

regards

koel

[560 byte] By [koel78] at [2007-9-26 3:12:10]
# 1
This is just a natural join between two tables.The query can be like this: select b.sub_cat_name, a.cat_name fromcategory a, sub_category b where a.cat_id = b.cat_idPl. let me know whether this solves your problem.
venkat_shiv at 2007-6-29 11:20:19 > top of Java-index,Archived Forums,Java Programming...
# 2
hi,u can even create a view with the above join statement, and u can use it if u want to access it with JDBC.
bhuvana_76 at 2007-6-29 11:20:19 > top of Java-index,Archived Forums,Java Programming...