how to add row to the result query
-
i have a query that returns 2 rows and i want to add 1 row manualy, so the final query would return 3 rows. can anyone help me with this?
cellardoor
-
i have a query that returns 2 rows and i want to add 1 row manualy, so the final query would return 3 rows. can anyone help me with this?
cellardoor
Select your 2 rows into a view or temporary table, then add your additional row into that view/table. Final step: select everything from that table/view. Note: if you are using stored procedures, then temporary table will be deleted automatically when the stored procedure is done (at least in SQL 2005)
Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O
-
i have a query that returns 2 rows and i want to add 1 row manualy, so the final query would return 3 rows. can anyone help me with this?
cellardoor
select Column1,Column2 from MyTable
union
select 9000 as Column1,'whatever' as Column2--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters
-
select Column1,Column2 from MyTable
union
select 9000 as Column1,'whatever' as Column2--EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters
thanks
cellardoor