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.
| Author |
Topic |
|
a4nsd
Starting Member
20 Posts |
Posted - 2006-12-20 : 00:25:27
|
| Hi.every one. I have a problem when I use this querryselect replace(Title,'.','')AS Title1, ID from tbl_Sim Where Title1 LIKE '%377%'And here is my recordTitle : 0988.613.775ID : 2and here is the error: Invalid column name 'Title1'.Can any one show me how to run this querry, I want to TRIM the 'Title' before it can be compared with another conditionI am a beginner. Thanks alots! |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-12-20 : 00:53:07
|
select replace(Title,'.','')AS Title1, ID from tbl_Sim Where replace(Title,'.','') LIKE '%377%'You can't refer to the aliased column in the where clause.Duane. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-20 : 03:43:28
|
| 1 You can directly use alias name only at Order by caluse2 Derived table is your friendSelect * from(select replace(Title,'.','')AS Title1, ID from tbl_Sim)T Where Title1 LIKE '%377%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|