The data of table tblLeave is as below: (note: leaveId is Primary, and leave is in index for unique data)
leaveId leave
1 Home Leave
2 Sick Leave
3 Maternity Leave
4 Maternity Leave (Male)
5 Mourning Leave
Actually I want the result as below data that leaveId should be in ascending.
0 <Select All>
1 Home Leave
2 Sick Leave
3 Maternity Leave
4 Maternity Leave (Male)
5 Mourning Leave
But I Could not make it ascending.
My Code as below:
CREATE VIEW vLeave
SELECT TOP 100 PERCENT leaveId, leaveName FROM tblLeave
UNION ALL
SELECT 0,'<Select All>'
order by leaveId
I used in this way also..
CREATE VIEW vLeave AS
SELECT 0,'<Select All>'
UNION ALL
SELECT TOP 100 PERCENT leaveId, leaveName FROM tblLeave ORDER BY leaveId
but
when I run query Like this
"select * from vLeave", it doesnot work as I want.