Hi,
I finally found the solution
"SELECT count( smsc_id ) AS total, week( insertdate ) AS tanggal
FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB( CURRENT_DATE( ) , INTERVAL 4 WEEK )
AND CURRENT_DATE( )
GROUP BY week( insertdate )"
Willy
--
MySQL General Mailing List
For list archives: http://
Hi, I have tried to use this query: "SELECT count(smsc_id) as total,
insertdate FROM momtbak WHERE insertdate BETWEEN
DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE() group by
week(date_format(insertdate,'%Y-%m-%d'),3)" to group records in the
last 4 weeks by week. But the result re
com
Cc: sangprabv <[EMAIL PROTECTED]>
Subject: Re: Query to Select records in the last 4 weeks
Date: Wed, 03 Dec 2008 17:52:32 -0800
SELECT * FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE();
--
MySQL General Mailing List
For list ar
On Thu, 2008-12-04 at 08:27 +0700, sangprabv wrote:
> Hi,
> I get stuck to build a query to select records between curdate() and the
> last 4 weeks and groupped by week. I tested with:
>
> "SELECT *
> FROM momtbak
> WHERE insertdate
> BETWEEN curdate( )
> AND curdate( ) - INTERVAL 4 week"
>
>
On Tue, 24 May 2005 [EMAIL PROTECTED] wrote:
>Selon Dan Bolser <[EMAIL PROTECTED]>:
>
>>
>> Hello,
>>
>> I have data like this
>>
>> PK GRP_COL
>> 1A
>> 2A
>> 3A
>> 4B
>> 5B
>> 6B
>> 7C
>> 8C
>> 9C
>>
>>
>> And I want to write a query to select data like this.
>I agree, especially with the additional information the OP provided about
>his REAL table structure. A separate groups table makes better sense.
>
>Let this be an object lesson to others looking for assistance: If you want
>timely and useful assistance, provide real and complete information
Michael Stassen <[EMAIL PROTECTED]> wrote on 05/24/2005 10:26:14
AM:
> [EMAIL PROTECTED] wrote:
>
> > Dan Bolser <[EMAIL PROTECTED]> wrote on 05/24/2005 06:08:32 AM:
> >
> >>Hello,
> >>
> >>I have data like this
> >>
> >>PK GRP_COL
> >>1 A
> >>2 A
> >>3 A
> >>4 B
> >>5 B
> >>6 B
>
Hi,
I read "FK is a random (or otherwise)"
But i prefer your help !!
Selon Michael Stassen <[EMAIL PROTECTED]>:
>
> How on earth will that help? What does the ASCII (byte) code of GRP_COL
> have to do with what Dan wants?
>
> [EMAIL PROTECTED] wrote:
>
> > Hi,
> > try for axample,
> >
> > sele
[EMAIL PROTECTED] wrote:
Dan Bolser <[EMAIL PROTECTED]> wrote on 05/24/2005 06:08:32 AM:
Hello,
I have data like this
PK GRP_COL
1 A
2 A
3 A
4 B
5 B
6 B
7 C
8 C
9 C
And I want to write a query to select data like this...
PK FK GRP_COL
1 1 A
2 1 A
3 1 A
4
On Tue, 24 May 2005 [EMAIL PROTECTED] wrote:
>Hi,
>try for axample,
>
>select PK, ord(GRP_COL),COL from your_table;
When I said my data was 'like' the below I should have been more specific.
Here is some of my data (with reference to the simplified data (and
question details) below);
INPUT:
<-
How on earth will that help? What does the ASCII (byte) code of GRP_COL
have to do with what Dan wants?
[EMAIL PROTECTED] wrote:
Hi,
try for axample,
select PK, ord(GRP_COL),COL from your_table;
Mathias
Selon Dan Bolser <[EMAIL PROTECTED]>:
Hello,
I have data like this
PK GRP_
Dan Bolser <[EMAIL PROTECTED]> wrote on 05/24/2005 06:08:32 AM:
>
> Hello,
>
> I have data like this
>
> PK GRP_COL
> 1 A
> 2 A
> 3 A
> 4 B
> 5 B
> 6 B
> 7 C
> 8 C
> 9 C
>
>
> And I want to write a query to select data like this...
>
> PK FK GRP_COL
> 1 1 A
> 2
Hi,
try for axample,
select PK, ord(GRP_COL),COL from your_table;
Mathias
Selon Dan Bolser <[EMAIL PROTECTED]>:
>
> Hello,
>
> I have data like this
>
> PKGRP_COL
> 1 A
> 2 A
> 3 A
> 4 B
> 5 B
> 6 B
> 7 C
> 8 C
> 9 C
>
>
> And I want to write a query to
13 matches
Mail list logo