Question

Asked on 2004-11-18 at 21:53:51ID: 25475797

How to sort by days of the week in Oracle 9i

by: tilacakr250

Rating7.2Very Good

I'm running the following SQL statement:

SELECT last_name, hire_date, TO_CHAR(hire-date, 'fmDay') "Day"
FROM employees;

I need to sort (or ORDER BY) the day of the week (the column entitled "Day" above) starting with Monday.

I've tried a lot of different things, but nothing is working. Can I do this without having to creat a new table to give a numeric value to the day?

Thanks,
Tim

  1. ORACLE -- "SORT" varchar2 ?
    How can I change the below so "A10011" appears lower in the list ? SELECT fmr.FMCODE FROM FMRESOURCE fmr where substr(fmr.fmcode,1,1) between 'A' and 'Z' order by fmcode
  2. week of day problem
    hi guys, i am using to_number(to_char(sysdate,'D') ) to get the week of day but it runs depend on regional settings and if it is amrican it gives 2 and if it is english it gives 1 for monday. but i dont would like to be dependent on the regional settings. i would like to be independent. is there any function to return the week of day independent…
  3. Oracle, database, 10, showing the date of t…
    folks how do i show the first day of the week in dateform of a certain week ie week 25 will show 15-6-2008 all help will do
  4. how to sort numbers from high to low and top 1…
    Hi, I attached my query in Oracle 8i. But, I don't know how to do two things, Can you help 1. I want to sort count(customer_name) from high to low each group 2. I want to display only top 10 (high-low) each group
  5. <ALL> to sort before numeric
    PL/SQL Oracle 10 g Is there a trick to sorting the static value '<ALL>' at the top For example the item is sorting 100 <ALL> apple would like <ALL> at the top

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
9i order to_char
Participating Experts
7
Solution Grade
B

Replies

 by: Sys_Prog

Posted on 2004-11-18 at 21:57:18ID: 28332907

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: tilacakr

Posted on 2004-11-18 at 22:02:45ID: 28332908

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: tilacakr

Posted on 2004-11-18 at 22:05:16ID: 28332909

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: izblank

Posted on 2004-11-18 at 22:25:32ID: 28332910

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pratikroy

Posted on 2004-11-19 at 00:06:13ID: 28332911

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: ploubier

Posted on 2004-11-19 at 00:17:06ID: 28332912

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pratikroy

Posted on 2004-11-19 at 00:17:15ID: 28332913

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pratikroy

Posted on 2004-11-19 at 00:20:02ID: 28332914

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by:

Posted on 2004-11-19 at 03:41:16ID: 28332915

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: lilian-arnaud

Posted on 2004-11-19 at 14:30:31ID: 28332916

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: tilacakr

Posted on 2004-11-19 at 19:31:25ID: 28332917

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pratikroy

Posted on 2004-11-20 at 00:28:35ID: 28332918

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: pratikroy

Posted on 2004-11-20 at 00:30:47ID: 28332919

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: ploubier

Posted on 2004-11-22 at 00:27:59ID: 28332920

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: a_savage

Posted on 2004-11-23 at 01:33:14ID: 28332921

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: anand_2000v

Posted on 2004-11-25 at 05:32:26ID: 28332922

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: tilacakr

Posted on 2004-12-20 at 19:26:55ID: 28332923

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert