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 |
|
ibanez_destroyer
Starting Member
3 Posts |
Posted - 2004-02-17 : 21:49:14
|
| Hi guys. I am new to this forum and i am a beginner in SQL. Today, i had encouter a command:SELECT pname, pcredit, 'over limit'FROM passengerWhat's the meaning of the thing inside the '', which is 'over limit'?Thank you- hamlet - |
|
|
simondeutsch
Aged Yak Warrior
547 Posts |
Posted - 2004-02-17 : 22:17:57
|
| Meaning in SQL: It's an expression, a value that does not change from row to row. Every row in the result will say Over Limit in that column regardless of pname or pcredit values. Expressions must be surrounded by single quotes in SQL Server.Meaning in English: Person's credit has been overused. They have spent more than allowed, or haven't paid up.Sarah Berger MCSD |
 |
|
|
ibanez_destroyer
Starting Member
3 Posts |
Posted - 2004-02-17 : 23:05:53
|
| Thank you for your reply. Still about the same issue, what will the query return? Is itpname, and pcredit of those people who's credit is over limit?Thanks.- hamlet - |
 |
|
|
samrat
Yak Posting Veteran
94 Posts |
Posted - 2004-02-17 : 23:14:44
|
| G'dday, Try and make it simpler for you... Say you had 2 fields in your table PNAME, PCREDIT in your passenger table. Sample DataPNAME PCREDIT ABC 1000 XYZ 2000THY 500IHY 4500 Your Query: SELECT pname, pcredit, 'over limit'FROM passengerwill return PNAME PCREDIT ABC 1000 Over limitXYZ 2000 Over LimitTHY 500 Over LimitIHY 4500 Over LimitAnd hence as Sarah mentoined its a expression and its value wont change. Now, If you need to filter the data you need to use the WHERE clause (refer to BOL) with familiarising yourself with basic SQL syntax.HTH, Samrat |
 |
|
|
ibanez_destroyer
Starting Member
3 Posts |
Posted - 2004-02-18 : 00:24:57
|
| Wow.. thanks a lot, Sarah, Samrat. :) Good day.- hamlet - |
 |
|
|
|
|
|
|
|