...

View Full Version : SQL request



angiras
11-18-2003, 12:24 PM
I have the following table (access 2000) for categories >>>

id_category
level
id_categorySup
categoryName


now I want to get a list (select) of level 2 >>>

SELECT id_category AS id, id_categorySup & " : " & categoryName AS name
FROM category
WHERE level=2

then I get something like >>>

<option value="24">4 : Office</option>

but in my Table : 4 = Software , how can I do a request to get >>>

<option value="24">Software : Office</option>

?

thank you

A1ien51
11-18-2003, 01:24 PM
SELECT a.id_category AS id,
b.id_categoryName & " : " & a.categoryName AS name
FROM category a,
category b
WHERE level = '2'
AND a.id_categorySup = b.id_category


This is a poor way to do a join but it works
not sure if the columns name are right with the way you are pulling info, but I think it should work.

angiras
11-18-2003, 02:04 PM
can't believe it !!!!!!!!!!!!!!!!!!!!!
a wonder !

it works ! mamamammiaa it works !

thanks a ton



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum