Not sure there's a good way to do that ... here's one possible solution:
create a little extra table like so:
create table mytemptable
(mytemptable_id int not null auto_increment primary key,
table_id int,
key table_id_idx (table_id));
then insert your values for your IN clause into 'mytemptabl
I have a sql query like SELECT * FROM table WHERE id IN (4,88,23);
Result order in ID is: 4,23,88
But I need to receive result in order 4,88,23. So how can I manage to receive
result in order LIKE IN() clause?
regards, okan
I agree with keeping only dates or nulls in a date-type column. One other
option, you could use a NULL value for ModifyDate with the COALESCE()
function like this
SELECT, COALESCE(ModifyDate, CreationDate) as recordDate
FROM ...
WHERE ...
ORDER BY recordDate
if ModifyDate is not null, that
Hi Khan,
I would klike to approach ur problem in a diffrent manner.
My suggestion is that, in both the date fields u use dates only. (I
don't know the useabilty of '0' in a date field). While using this, u
have to store the creation time a the modification time, at the
creation of record. This is t
On Mon, 4 Oct 2004 11:03:13 +0200, Martijn Tonies <[EMAIL PROTECTED]> wrote:
> Hello,
>
> > I have two date fields (1095689105) in mysql. One is Creation date and
> > other is Modify date. If news is not modified its value is 0. How can I
> > sort my news so modify date is more important (if exist
Hello,
> I have two date fields (1095689105) in mysql. One is Creation date and
> other is Modify date. If news is not modified its value is 0. How can I
> sort my news so modify date is more important (if exists) than creation
> date?
What about an ORDER BY with a CASE statement that uses
the Cr
Hello,
I have two date fields (1095689105) in mysql. One is Creation date and
other is Modify date. If news is not modified its value is 0. How can I
sort my news so modify date is more important (if exists) than creation
date?
TNX
--
MySQL General Mailing List
For list archives: http://lists.
please help! i have all indices in place and my sql queries are all very
fast etc. UNTIL i do the following:
select
count(id)
,count(distinct username) thecount
from
appviews
group by
id
order by thecount
briefly put, this query tries to get the the overall views f
Dionne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 7:25 PM
Subject: Need help about mysql order and index
> Hi there, I hope someone will can help me... First, sorry for bad
english :)
> i
st
mysql 4? stable or not? :)
Jean-Francois Dionne
- Original Message -
From: "Jean-Francois Dionne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 7:25 PM
Subject: Need help about mysql order and index
> Hi there, I hope someo
Hi there, I hope someone will can help me... First, sorry for bad english :)
i'm french
First all I have those index in my table
+---+---+-++
--+-++--++--
+
|
René,
> I want to select about 25 rows from a table, and sort them by two
> criteria. First, by each row's Series field ("Baby", "Genesis", "Super",
> "Predator", "Millennium" are the various Series, and the order I'd like
> the rows in the array). Within each Series, I'd like the rows sorted by
t
> on that?
>
> otherwise you'll have to use php
>
> -Original Message-
> From: René Fournier [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 04, 2001 12:16 PM
> To: Benjamin Pflugmann; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Re: MySQ
Hi.
On Mon, Dec 03, 2001 at 06:16:26PM -0700, [EMAIL PROTECTED] wrote:
> The problem is, if I sort by the price field, the ordering of the series
> gets mixed up (since low-end models in higher-end series cost more than
> some higher-end models in lower-end series (confused?? I am :-) If I
>
From: René Fournier <[EMAIL PROTECTED]>
Date: Mon Dec 03, 2001 06:11:23 PM US/Mountain
To: Benjamin Pflugmann <[EMAIL PROTECTED]>
Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Re: MySQL ORDER BY or PHP Sort? Oops.
Here is the snippet of code th
Hi.
Because you said, Rene, that you already know how to sort according to
one of both criteria, I presume ordering the series column is not the
problem (e.g. because it is an enum or something alike).
Then the solution would simply be to do something like
SELECT * FROM my_table WHERE ... ORDER
This would be pretty ugly, but you could adapt a trick that was posted to
the MySQL list back in Sept.
select * from ... where series != "Baby", series != "Genesis", series !=
"Super", etc.
Like I said, ugly, and I don't know how efficient it would be (probably
not very), but it would get the
Well I think mysql doesnt allow you to do this that simple as mysql
doesnt know how you want to sort it exactly. So my suggestion would be to
give a value to each series, eg. Baby = 1,
Genesis=2,Super=3,Predator=4,Millennium=5 and then order by series.
Cheers
Siim Einfeldt
> One more thing
> Now, I know how to structure my MySQL Select statment such that the rows
> it pulls from the table will be either sorted by Price OR by Series, but
> not both, in the way I'd like. Does anyone know if it's possibly to do
> this in the Select statement itself? (I'd rather do it that way, tha
One more thing, very important: I want to specify the Series sort order,
not alphabetically, but by a non-obvious way
(Baby>Genesis>Super>Predator>Millennium)...
--
I want to select about 25 rows from a table, and sort them by two
criteria. First, by each row's Series field ("Baby", "Gene
I want to select about 25 rows from a table, and sort them by two
criteria. First, by each row's Series field ("Baby", "Genesis", "Super",
"Predator", "Millennium" are the various Series, and the order I'd like
the rows in the array). Within each Series, I'd like the rows sorted by
their Price
d00d. manual. search it.
http://www.mysql.com/doc/S/o/Sorting_rows.html
ORDER BY VOTES DESC
dpk
- Original Message -
From: "Russ" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 3:27 PM
Subject: mySQL: ORDER
> how do i sort my
At 11:27 PM +0100 9/14/01, Russ wrote:
>how do i sort my results by reverse order ?? say the collume containts 1 2 3
>4 , if i use ORDER BY VOTES it returnes 1234 but i wont it in revers 4321
>etc is there any way i can do this with a sql function?
ORDER BY VOTES DESC
DESC = descending (reverse
In the last episode (Sep 14), Russ said:
> how do i sort my results by reverse order ?? say the collume containts 1 2 3
> 4 , if i use ORDER BY VOTES it returnes 1234 but i wont it in revers 4321
> etc is there any way i can do this with a sql function?
ORDER BY VOTES DESC
--
Dan Nelson
how do i sort my results by reverse order ?? say the collume containts 1 2 3
4 , if i use ORDER BY VOTES it returnes 1234 but i wont it in revers 4321
etc is there any way i can do this with a sql function?
Russ
-
Before posti
25 matches
Mail list logo