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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Quickie--How can I select fixed values ??

Author  Topic 

RichardEttinger
Starting Member

7 Posts

Posted - 2004-02-20 : 16:59:22
How can I select fixed values to get rows 1 2 3 and 4??

select 1 union select 2 union select 3 union select 4
seems kindof lengthy to produce rows 1 2 3 and 4??

If this is the only way how can I order this by ascending as it comes back in miscellaneous order

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-02-20 : 17:09:27
ORDER BY 1

Tara
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2004-02-20 : 20:26:39
Richard, are you really looking for the literal values 1, 2, 3, and 4? Or do you want the first 4 rows of data? If the latter, then do something like SELECT TOP 4...

--------------------------------------------------------------
Find more words of wisdom at [url]http://weblogs.sqlteam.com/markc[/url]
Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2004-02-21 : 00:32:20
Search the site for tally tables.

Go to Top of Page
   

- Advertisement -