Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to substring.........?

Author  Topic 

jonasdavedomingo
Starting Member

33 Posts

Posted - 2004-09-11 : 07:23:44
Let's say i have 2 tables namely TBL_ONE and TBL_TWO.

TBL_ONE has 1 column and 1 row that has the value 1.
one_Value
Row1: 1

TBL_TWO has 1 column and 1 row.
two_Value
Row1: 1 - High

query = SELECT * FROM TBL_ONE, TBL_TWO WHERE one_Value = two_Value;


what i want to know is how do u substring column name? coz i want to get the 1st chracter of TBL_TWO row1 which is 1 - High

iv tried
query = SELECT * FROM TBL_ONE, TBL_TWO WHERE one_Value = two_Value.substring(0,1);
but it doesnt work.

what is the code for substring?

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2004-09-11 : 07:33:41
Hi,

Please use left function inspite of substring. I am not saying that it is not possible with the help of substring but this is another way of doing it.

So try

SELECT * FROM TBL_ONE, TBL_TWO WHERE one_Value = left(two_Value,1)


Regards
Sachin

Go to Top of Page

jonasdavedomingo
Starting Member

33 Posts

Posted - 2004-09-11 : 07:37:37
thanks mahn! it works. thanks so much!
Go to Top of Page
   

- Advertisement -