You are here: Re: Query Assistance Needed - Please « MsSQL Server « IT news, forums, messages
Re: Query Assistance Needed - Please

Posted by marcsirois on 10/11/06 19:17

Hi there,

I think this would work:

===========================================
select T1.id, T1.name, T1.ParentTagId, T2.Name As ParentTagName
from Tags T1,
Tags T2
where T1.ParentTagId = t2.Id
===========================================

Thanks,

Marc

Andrew Tatum wrote:
> Alright, I have this table called Tags. The three columns of interest
> are Tags.Id, Tags.Name, Tags.ParentTagId
>
> This is the query I am currently using:
>
> Select Tags.Id, Tags.Name, Tags.ParentTagId
> >From Tags
> WHERE Tags.Id IN (
> 22536,
> 22535
> )
>
> This outputs to:
>
> Id Name ParentTagId
> ----- ------------ --------------
> 22535 Courses 148
> 22536 AEB3300-2204 22535
>
> Obviously, Courses is the Parent Tag Name to AEB3300-2204. How can I
> get this to show up so the results are something like
>
> Id Name ParentTagId ParentTagName
> ----- ------------ --------------
> --------------
> 22535 Courses 148 SomeName
> 22536 AEB3300-2204 22535 Courses
>
> Thank you all for your help! I truly appreciate it!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация