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.
| Author |
Topic |
|
xpandre
Posting Yak Master
212 Posts |
Posted - 2002-08-12 : 09:57:47
|
| Hi,How do i add an extra row...a dummy in my result set?thanxSam |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-08-12 : 10:04:13
|
| UNIONselect col1 from mytableunionselect 'dummy'(col1 and 'dummy' must be of compatible types)Jay White{0} |
 |
|
|
xpandre
Posting Yak Master
212 Posts |
Posted - 2002-08-12 : 10:06:17
|
| thanx!!but 1 probs!!its like thisselect * from table1unionselect 'dummy','dummy','dummy' from table1wat if i dont have the count of the no of cols returned..thanxSam |
 |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-08-12 : 10:10:15
|
quote: wat if i dont have the count of the no of cols returned..
Then you can't do it .Reason Number 47 why 'SELECT *' is a poor construct for production queries.Jay White{0} |
 |
|
|
xpandre
Posting Yak Master
212 Posts |
Posted - 2002-08-12 : 10:20:20
|
| :Dthanx!!! |
 |
|
|
xpandre
Posting Yak Master
212 Posts |
Posted - 2002-08-12 : 10:50:08
|
| ne other ideas? |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-08-12 : 11:21:36
|
If all your 'dummy' values are actually NULLs then it's possible... though why you would want to add a row of NULLs to your result is beyond me.SELECT * FROM mytableUNION ALLSELECT mytable.* FROM (SELECT 1 AS A) AS A LEFT JOIN mytable ON 1 = 0 |
 |
|
|
|
|
|