472,371 Members | 1,552 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Find Partial Text From Return Of Subquery

76
I don't even know if this is even possible but I figured it'd make my life a lot easier if it was. I have an organizational table with departments and subdepartments that has a chain of command listing in it. (I didn't design it, don't shoot me, I'm just having to fix it). What I need to do is find a department and all departments beneath it based on the passed in value of the department's ID. I'm right now keying off the chain of command since the chain of command is from the top down.

SELECT *
FROM Department
WHERE (COC LIKE
(SELECT COC
FROM Department
WHERE DeptID = '12345'))

Though of course this doesn't work. It will only return those identical to the returned value. If I were to just "do it" without a subquery it'd be
SELECT * FROM Department WHERE COC LIKE '1;14;16;232;12345;' and it would return everything from this department downward.

Is there a way to do a partial like on a subquery results?
Jan 25 '07 #1
1 1701
iburyak
1,017 Expert 512MB
Not sure if I understood you correctly but try this:

Select *
from Department a
join Department b on a.COC = b.DeptID
where a.DeptID = '12345'
Jan 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Al | last post by:
Hi, I am currently using IndexOf to see if a string contains another string but it only works if there is exact match. In case of misspelling etc it wont work. I was wondering if anyone aware of...
3
by: Lucky | last post by:
Hi guys! it's me againe! this time i'm facing some problem with the .NET 2005 IDE. i've created one "website" and i've added one webform. now i can see 2 files default.aspx and default.aspx.cs...
2
by: Bryan_Cockrell | last post by:
Hi World, I am extracting text from an ebcdic header using dd in the cygwin environment (bash/ksh) as below in order to rename the file to something intelligent. I'm using a specific string...
1
by: amber.inc | last post by:
HI, I would like to know how can i find a text of a PDF file and change the forecolor of the text to blue with the help of JAVASCRIPT or any other language so that it can work on Acrobat 5.0....
8
by: kingskippus | last post by:
I don't know if this is possible, but I haven't been able to find any information. I have two tables, for example: Table 1 (two columns, id and foo) id foo --- ----- 1 foo_a 2 foo_b
1
by: rmr | last post by:
Hi, I would like to restrict the text that appears in a cell to the first few letters or a fixed width in pixel. And for other processing reasons I wish the full text to be available in the cell...
3
by: Lauren Quantrell | last post by:
I have an HTML file named myHTML.htm It looks like this: <great HTML code> <more great HTML code> <even more great HTML code> <insert HTML here>
1
by: gravikrishna | last post by:
hello sir pls tell me the code of my question how do u find total text of a html page in .net
1
by: Malvika Shrivastava | last post by:
Hi everyone, I want to find the text which is highlighted with a particular colour in a word document. Thanks, Malvika.
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.