One more thing... What are you using to pull the data?  PHP?  Perl?
Etc?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 05, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: Query help please!


I need help writing query that would give me parent categories of catID
from categories table. 
For example, if catID=030 then it should give me:
Birthday | Special Birthday | Special Birthday
If catID=028
Birthday | General Birthday | NULL

>desc categories
+-------+----------+------------------------+
| catID | parentID | catName                |
+-------+----------+------------------------+
|   001 |      000 | Birthday               |
|   002 |      000 | Get Well               |
|   003 |      000 | Special Occasions      |
|   038 |      029 | 40th                   |
|   037 |      029 | 30th                   |
|   036 |      029 | 21st                   |
|   035 |      029 | 16th                   |
|   029 |      001 | Special Birthday       |
|   028 |      001 | General Birthday       |
|   030 |      029 | Inspirational          |
|   045 |      001 | Children's Birthday    |
|   046 |      045 | 1st                    |
+-------+----------+------------------------+

Pinkesh

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to