12,400,183 members (43,396 online)
Rate this:
See more:
Hi Friends,

I have a Currency table with records as follows :

ID Name
1 INR
2 USD
3 SGD
4 EURO
. .
. .

When I fire a query like, `select * from Currecny`, I get the recordset as shown.

But I want to get " SGD " as my first record, then all remaining records.

How can I get this?

Any help appreciated.

Thanks,
Lok.
Posted 22-Dec-11 18:22pm
Updated 22-Dec-11 19:47pm
RaisKazi34.3K
v2

Rate this:

## Solution 2

Amir's answer is enough but here alternative solution
Add an another column in your table(Ex. Default or DisplayOrder), see below table.
```ID Name IsDefault
-----------------
1 INR   N
2 USD   N
3 SGD   Y
4 EURO  N```
Use the Below Query
`SELECT * FROM [Table] ORDER BY SGD DESC`
```ID Name DisplayOrder
-----------------
1 INR   2
2 USD   3
3 SGD   1
4 EURO  4```
`SELECT * FROM [Table] ORDER BY DisplayOrder`
Amir Mahfoozi 23-Dec-11 1:05am

+5 Yes, I always use display order in my own projects :)
rks0191@gmail.com 15-Oct-13 5:22am

nice one :)
RaviRanjankr 23-Dec-11 1:36am

5+
Rate this:

## Solution 3

```select * from currency
order by
case name
when 'SGD' then 1
else 2
end
```
Amir Mahfoozi 23-Dec-11 4:36am

+5 Another good solution.
Scubapro 23-Dec-11 4:38am

Tnx!
Rate this:

## Solution 1

Try this :
```select * from currency where id=3
union all
select * from color where id<>3```
thatraja 23-Dec-11 1:02am

5!
RaviRanjankr 23-Dec-11 1:36am

My 5+
LokeshZende 23-Dec-11 3:11am

Thanks Amir... :)
Amir Mahfoozi 23-Dec-11 4:27am

You're welcome :)

Top Experts
Last 24hrsThis month
 OriginalGriff 315 ppolymorphe 300 Vincent Maverick Durano 265 0x01AA 175 Karthik Bangalore 165
 OriginalGriff 6,823 ppolymorphe 2,885 Karthik Bangalore 2,737 Richard MacCutchan 2,057 F-ES Sitecore 2,052