Query sql on string

Posted by simone on Stack Overflow See other posts from Stack Overflow or by simone
Published on 2010-01-20T14:24:51Z Indexed on 2010/03/12 8:57 UTC
Read the original article Hit count: 145

Filed under:
|
|

hi all,

I have a db with users that have all this record .

I would like to do a query on a data like

CN=aaa, OU=Domain,OU=User, OU=bbbbbb,OU=Department, OU=cccc, OU=AUTO, DC=dddddd, DC=com

and I need to group all users by the same ou=department.

How can I do the select with the substring to search a department??

My idea for the solution is to create another table that is like this:

---------------------------------------------------
ldapstring                           | society | site
---------------------------------------------------
"CN=aaa, OU=Domain,OU=User, OU=bbbbbb,OU=Department, OU=cccc, OU=AUTO, DC=dddddd, DC=com" | societyName1 | societySite1

and my idea is to compare the string with these on the new table with the tag like but how can I take the society and site when the like string occurs?????

Please help me

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server