473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I am a newbie to mysql.plz help!.How to order the records in a table such that.......

28
How to order the records in a table such that the elements in a field strating with a particular alphabet apper first.

ie.,the elements in the field names are as follows:

amar
Bob
joy
mana
sana
xena

I want it as: If 'm' is my input then 'mana' must apper first but all the records must also appear.

something like this:
mana
sana
xena
amar
Bob
joy.

Hoping that anyone of you will help me>>>>>>>..

Thanks i advance.
-ram
Dec 15 '06 #1
1 1262
ronverdonk
4,258 Expert 4TB
Use a UNION to append the rows >= criteria with the rows < criteria, as follows:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table 
  2.       WHERE SUBSTR(name,1,1) >= 'M' 
  3.       UNION 
  4.       SELECT * FROM table 
  5.       WHERE SUBSTR(name,1,1) < 'M';
  6.  
Ronald :cool:
Dec 18 '06 #2

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

Similar topics

0
by: Girish Agarwal | last post by:
--0-474210375-1058976151=:31789 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Note: forwarded message attached. __________________________________
0
by: Annie Xie | last post by:
Any one could help? 1> anyone has a compiled tarball for mysql new version (-4.0 up) for solaris 2.6 can be shared? The OS was patched latest. 2> I'm trying build it, configure w/o any...
0
by: Yun Guan | last post by:
Hello mysql gurus, I am trying to run perl on mysql database on Red Hat box. I want to install DBI and DBD:mysql using CPAN: perl -MCPAN -e shell cpan>install DBI The above succeeded, but...
0
by: ./Rob & | last post by:
Hi gang: I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it...
1
by: smsabu2002 | last post by:
Hi, I am facing the build problem while installing the DBD-MySql perl module (ver 2.9008) using both GCC and CC compilers in HP-UX machine. For the Build using GCC, the compiler error is...
0
by: pvannie | last post by:
Hello there, I've been trying to install DBD::mysql on Mac OS X Server 10.3 for 2 days, but it still raises error. So I'm going to send this message to ask for help. Any help will be much...
1
by: pvannie | last post by:
Hello there, I've been trying to install DBD::mysql on Mac OS X Server 10.3 for 2 days, but it still raises error. So I'm going to send this message to ask for help. Any help will be much...
1
by: usmdog | last post by:
I am trying to setup MySql 4.0.2.6 according to my school book "PHP fast&easy web development" on a WinXP Professional SP2 system. Everytime I try to create a database this message below comes up....
2
by: gavilaso | last post by:
Hi, i'm completly a newbie on PHP, I'm trying to make a static site search where i'm giong to put 2 category on a combobox for query.. box 1 Citys Carolina San Juan Ponce Box 2 ...
8
by: wizardry | last post by:
Hello - as the title states i'm a newbie to php! This is what i would like to do: start a session to caputure data from the user then when they submit the data to be stored in mysql db...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.