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 |
|
Rachel_ch19
Starting Member
5 Posts |
Posted - 2010-11-30 : 15:10:07
|
| What's the difference in using them?I'm a newbie to SQL....Thanks! |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-11-30 : 15:36:47
|
| Neither of what you describe is valid SQL syntax. AS is for defining aliases and LIKE is a where clause comparison operator--Gail ShawSQL Server MVP |
 |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-30 : 15:38:40
|
| There is no such thing as "SELECT LIKE"AS creates an alias. LIKE is for textual comparisons.SELECT 1 as [alias]SELECT * FROM SomeTable WHERE name LIKE 'russell' |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-30 : 15:40:00
|
Can you post an example where SELECT AS is used and another example where SELECT LIKE is used?Because it is not clear to me what you need to know... No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Rachel_ch19
Starting Member
5 Posts |
Posted - 2010-11-30 : 15:46:26
|
| Thank you for your replies!My understanding now is select ...as gives another name to the subject, and select like statement is to select sth with certain characteristics.Right?Example: select ...as...select A, count(*) as B into C from AAExample: select... like...SELECT * FROM customers WHERE companyname LIKE 'a%' |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-11-30 : 15:52:29
|
Yes!  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|