2011-04-04 92 views

回答

6

试试这个:

如果你只是想选择:

SELECT ename, esalary * 1.1 
    INTO name, salary 
    FROM employee 
WHERE eno='113' 

如果您想更新

UPDATE employee 
    SET salary = salary * 1.1 
--If the base salary is store in esalary then use 
--SET salary = esalary * 1.1 
WHERE eno='113' 
+0

@Cyber​​nate在第一次查询后,我会这样做吗? – stoopid 2011-04-04 15:38:15

+0

在选择的例子中,你遗漏了INTO? – stoopid 2011-04-04 15:39:50

+0

如果你想更新数据,然后运行第二个查询...如果你想只显示工资增加10%运行第一个查询.... – Chandu 2011-04-04 15:40:05

1

select,试试这个:

select name, salary * 1.1 from Employee where Eno='113'; 

update

update employee set salary = salary * 1.1 where eno = '113' 
+0

您的select语句的问题是into子句。 – 2011-04-04 15:57:34