473,614 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Arbitrary order in SQL query

16 New Member
Hi All,

I want to sort oracle SQL as below
e.g. employee table having column name, now i want to display records where employee names start with letter 'L' should appear first then starts with 'B' and then start with 'F'.
Thanks in advance.
Bhushan
Jul 21 '08 #1
2 4610
amitpatel66
2,367 Recognized Expert Top Contributor
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM employee ORDER BY DECODE(UPPER(SUBSTR(fname,1,1)),'L',0,'B',1,'F',2,9);
  2.  
Jul 21 '08 #2
bhushanbagul
16 New Member
Thanks to you amit
Jul 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2056
by: Andrew | last post by:
It seems that in C#, given an instance "a" of some value type "A", one can pass a by reference to functions with signatures of either "void f(object obj)" or "void g(ref A obj)". But passing a into a function with signature "void f(ref object obj)" gives a compile error -- why (This is part of solving the original problem posed here: http://www.csharp-station.com/ShowPost.aspx?PostID=3625 What I need now is a method that accepts a ref to an...
5
3059
by: Mattias Brändström | last post by:
Hello! I am trying to find a minimal class/lib that handles arbitrary precision decimal numbers. I would be happy if this class supported as little as addition, subtraction, multiplication, division and comparisons. For some reason it's quite hard to find such a class on the net. Maybe because it is trivial to implement such a class? The only library I have found so far is MAPM (http://www.tc.umn.edu/~ringx004/mapm-main.html). This...
1
6171
by: Jeff Blee | last post by:
I hope someone can help me get this graph outputing in proper order. After help from Tom, I got a graph to display output from the previous 12 months and include the average of that output all in the one graph. The output was in the order of the months, but after unioning with the averages SQL code, the order is lost. Below is the full sql code that is the data source for the graph: SELECT (Format(.,"mmm"" '""yy")) AS Month,...
8
6805
by: kaosyeti | last post by:
i have a (hopefully) small problem. i have created a system where a user enters customer information into a table through a form. this table has no primary key. there are 9 fields on the form to be filled in, one of which is a date field. right now, i've been using this db myself and have entered only 10 days of sample data to check my calculations but i realized that there may be times when i need to add a record that was missed that...
104
10849
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through sorted by Numb. Everything I've read on the web suggests that including the TOP directive should enable ORDERY BY in views. Does someone have an idea why the sorting is not working correctly for this particular view? thanks. CREATE VIEW...
8
2667
by: kd | last post by:
Newbie question here. It's been a while since I've done C programming, and I hit a wall last night. Let's say I have a three dimensional array, like so: int p = {{{0,0,0}, {1,1,1}, {0,1,0}},
0
1428
by: Conrad | last post by:
Greetings, For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie Windows) to the next (ie Linux)? Specifically, I have a convience aggregate class that combines a wxStaticText with a wxComboBox, as I often need those two at the same time. The aggregate catches events from the wxComboBox
6
5466
by: InnoCreate | last post by:
Hi everyone. I've recently written a classic asp website which uses an MS Access datasource. I know this is less than an ideal data source as it has limited functionality. I have a search form on my website which allows users to define parameters and return results accordingly. The problem i have is a need to return these results in a random order each time. With SQLServer i know NEWID() would do the trick - used this many times before...
2
1970
by: waylonflinn | last post by:
I'm looking for a way to invoke methods with an arbitrary number of parameters of arbitrary type from within a single method, when those parameters are known at the time of invocation of the containing method. I don't see a reason why this shouldn't work. I also can't find the language feature which implements it. More details below. As part of the creation of a set of classes for doing unit testing I want to create a generic...
1
1972
by: EwanD | last post by:
I am trying to read through and process an Access Query using VBA. I have used the OpenRecordset method with parameters as below OpenRecordset(sSourceRecordset, dbOpenDynaset) Where “sSourceRecordset” contains the name of the query I wish to read. I can then move through the records using .MoveNext
0
8182
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4052
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1425
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.