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
 General SQL Server Forums
 New to SQL Server Programming
 New with Database

Author  Topic 

yessi
Starting Member

2 Posts

Posted - 2006-03-27 : 21:13:05
Hi guys....im new with database and just learn now
and sorry if my question is very absic with database

i have employees table and in that table i have column employeeId, managerID and amount.

For example in that table i have filled the data
EmployeeID ManagerID Amount
Bob Sarah 500
Sarah Richard 1000
Richard Ryan 2000
Ryan Allen 3000
Allen Allen 500

the problem is when i want to retrieve data for example i want to retrieve employeeID where amount <=100
and when i execute this query

select EmployeeID, Amount where Amount<=100

it doesnt retrieve any data, if im not wrong...it should retrieve 5 rows based on that sample data that i had given above....

Is that something that i missed?

Any Help will be appreciated.....

Best Regards


Yessi

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-27 : 21:18:07
You missed out the FROM in your query
select EmployeeID, Amount FROM employees where Amount<=100


You wanted employee with amount <= 100. But in the sample data all Employee's Amout is greater than 100 ! So 0 records return



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-28 : 00:58:17
Also learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -