| Author |
Topic |
|
Suni
Starting Member
3 Posts |
Posted - 2008-06-24 : 04:11:32
|
| Hi,In one of the interview recently i faced below question. please answer thisI want to select all the data from Employees Without using Select Keyword.like "select * from Employees". without using select keywordi need to fetch all records from Employees. How do i do this |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-06-24 : 04:14:10
|
quote: i need to fetch all records from Employees. How do i do this
use dOg's keyword  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-24 : 04:17:17
|
[code]DELETE eOUTPUT *FROM Employees AS eUPDATE eSET e.EmpName = e.EmpNameOUTPUT *FROM Employees AS e[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-06-24 : 04:18:16
|
quote: Originally posted by Peso
DELETE eOUTPUT *FROM Employees AS eUPDATE eSET e.EmpName = e.EmpNameOUTPUT *FROM Employees AS e E 12°55'05.25"N 56°04'39.16"
I think i prefer the 1st query  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Suni
Starting Member
3 Posts |
Posted - 2008-06-24 : 04:29:55
|
| If i use any of the above queries i am getting error as followsIncorrect syntax near '*'. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-06-24 : 04:36:53
|
[code]UPDATE eSET e.EmpName = e.EmpNameOUTPUT inserted.*FROM Employees AS e[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Suni
Starting Member
3 Posts |
Posted - 2008-06-24 : 05:31:09
|
| Will this query works for normal table.i mean will this query works only on Inserted,deleted,updated tables? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-24 : 05:54:52
|
quote: Originally posted by Suni Will this query works for normal table.i mean will this query works only on Inserted,deleted,updated tables?
they are just internal tables containing value from your table which an action like insert,delete etc is performed on your table.so its same data in your table that is retrived. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-24 : 09:17:08
|
quote: Originally posted by Suni Hi,In one of the interview recently i faced below question. please answer thisI want to select all the data from Employees Without using Select Keyword.like "select * from Employees". without using select keywordi need to fetch all records from Employees. How do i do this
Why do you want to do this?MadhivananFailing to plan is Planning to fail |
 |
|
|
|