You should be able to just use "PID" in the where clause.

David Jordan

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen
Sent: Thursday, 29 December 2011 2:51 AM
To: U2 Users
Subject: [U2] MS-SQL Question

I'm querying a sequel server , I have a column in one table that the data is in 
the form of "X|Y|Z".

I have the following in my SELECT:

substring(colname ,charindex('|',colname)+1, charindex('|',colname, 
charindex('|',colname)+1) - charindex('|',colname) -1) as "PID"

Is there anyway that I can then use the "PID" designation  in a where clause, 
without having to retype the string again?


I can't add a virtual column to the table , and I can't add a procedure either.

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to