Professional Web Applications Themes

select query help - MySQL

Dear This is the sample data! Plase give me the solution. I tried my level best to solve this query but failed to do so. Thanks in advance "Abul Hasan" <abulhasan.lakhanimags.net.pk> wrote in message news:Om8h34IIEHA.3556TK2MSFTNGP10.phx.gbl... > Hello everyone, > > I want to extract weekly report from access dataabse into recordset. > Scenario is as follows > > WEEK Number of SMS > 1 50 > 2 25 > 3 30 > > obviously Weeks should be reset when month changes. > > Its urgent plz help > > >...

  1. #1

    Default Re: Select Query Help

    Dear

    This is the sample data!

    Plase give me the solution. I tried my level best to solve this query but
    failed to do so.

    Thanks in advance

    "Abul Hasan" <abulhasan.lakhanimags.net.pk> wrote in message
    news:Om8h34IIEHA.3556TK2MSFTNGP10.phx.gbl...
    > Hello everyone,
    >
    > I want to extract weekly report from access dataabse into recordset.
    > Scenario is as follows
    >
    > WEEK Number of SMS
    > 1 50
    > 2 25
    > 3 30
    >
    > obviously Weeks should be reset when month changes.
    >
    > Its urgent plz help
    >
    >
    >

    Abul Hasan Lakhani Guest

  2. #2

    Default Re: Select Query Help

    Abul Hasan wrote:
    > Hello everyone,
    >
    > I want to extract weekly report from access dataabse into recordset.
    > Scenario is as follows
    >
    > WEEK Number of SMS
    > 1 50
    > 2 25
    > 3 30
    >
    > obviously Weeks should be reset when month changes.
    Is that the source data or the desired results?

    You have not given us enough information. Please try again. When asking for
    help with a query, you should provide us with a few rows of sample data in
    tabular format (just the relevant columns - use the smallest number of
    columns required to illustrate the problem), followed by the results you
    wish to obtain from that sample data, again in tabular format.

    We need to know what is meant by "reset" and how we should know when the
    month changes.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  3. #3

    Default Re: Select Query Help

    I can't help you. I don't know what you want out of this data.

    Sorry

    Abul Hasan Lakhani wrote:
    > Dear
    >
    > This is the sample data!
    >
    > Plase give me the solution. I tried my level best to solve this query
    > but failed to do so.
    >
    > Thanks in advance
    >
    > "Abul Hasan" <abulhasan.lakhanimags.net.pk> wrote in message
    > news:Om8h34IIEHA.3556TK2MSFTNGP10.phx.gbl...
    >> Hello everyone,
    >>
    >> I want to extract weekly report from access dataabse into recordset.
    >> Scenario is as follows
    >>
    >> WEEK Number of SMS
    >> 1 50
    >> 2 25
    >> 3 30
    >>
    >> obviously Weeks should be reset when month changes.
    >>
    >> Its urgent plz help
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  4. #4

    Default Select Query Help

    Hello everyone,

    I want to extract weekly report from access dataabse into recordset.
    Scenario is as follows

    WEEK Number of SMS
    1 50
    2 25
    3 30

    obviously Weeks should be reset when month changes.

    Its urgent plz help



    Abul Hasan Guest

  5. #5

    Default Re: Select Query Help

    Abul, we need more information. If it's so urgent, then please see the
    instructions at [url]http://www.aspfaq.com/5006[/url] and give us enough information so
    we can help you.

    Can you fix my car? It's a '72 Camaro (convertible) and it won't start.
    You don't need any more information, do you?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]






    "Abul Hasan" <abulhasan.lakhanimags.net.pk> wrote in message
    news:Om8h34IIEHA.3556TK2MSFTNGP10.phx.gbl...
    > Hello everyone,
    >
    > I want to extract weekly report from access dataabse into recordset.
    > Scenario is as follows
    >
    > WEEK Number of SMS
    > 1 50
    > 2 25
    > 3 30
    >
    > obviously Weeks should be reset when month changes.
    >
    > Its urgent plz help
    >
    >
    >

    Aaron Bertrand [MVP] Guest

  6. #6

    Default Re: Select Query Help

    GROUP BY... was added to SQL because aggregate functions (like SUM) return
    the aggregate of all column values every time they are called, and without
    the GROUP BY function it was impossible to find the sum for each individual
    group of column values.

    The syntax for the GROUP BY function is:

    SELECT column,SUM(column) FROM table GROUP BY column

    SELECT * FROM myTable GROUP BY week

    Maarten
    "Abul Hasan Lakhani" <abulhasanlakhanisofthome.net> schreef in bericht
    news:%23S$i$RLIEHA.3840TK2MSFTNGP11.phx.gbl...
    > Dear
    >
    > This is the sample data!
    >
    > Plase give me the solution. I tried my level best to solve this query but
    > failed to do so.
    >
    > Thanks in advance
    >
    > "Abul Hasan" <abulhasan.lakhanimags.net.pk> wrote in message
    > news:Om8h34IIEHA.3556TK2MSFTNGP10.phx.gbl...
    > > Hello everyone,
    > >
    > > I want to extract weekly report from access dataabse into recordset.
    > > Scenario is as follows
    > >
    > > WEEK Number of SMS
    > > 1 50
    > > 2 25
    > > 3 30
    > >
    > > obviously Weeks should be reset when month changes.
    > >
    > > Its urgent plz help
    > >
    > >
    > >
    >
    >

    Maarten Guest

  7. #7

    Default select query help

    hi,

    how would I query my table to return only the records where the field
    'mobile' has a valid mobile telephone number.

    Valid being.. begining 07 and being 11 characters in length.

    many thanks,

    Dave


    Guest

  8. #8

    Default Re: select query help


    <meprivacy.net> wrote in message
    news:uti723-p9v.ln1mercury.tcm.vispa.net.uk...
    > hi,
    >
    > how would I query my table to return only the records where the field
    > 'mobile' has a valid mobile telephone number.
    >
    > Valid being.. begining 07 and being 11 characters in length.
    >
    > many thanks,
    >
    > Dave
    >
    something like:

    select mobile from table where mobile like '07%' and length(mobile) = 11;

    John


    >john Guest

  9. #9

    Default Re: select query help

    [email]meprivacy.net[/email] wrote:
    > hi,
    >
    > how would I query my table to return only the records where the field
    > 'mobile' has a valid mobile telephone number.
    >
    > Valid being.. begining 07 and being 11 characters in length.
    >
    > many thanks,
    >
    > Dave
    >
    >
    You can use a regular expression:

    select ... WHERE phone_column REGEXP '^07[[:alnum:]]{9}$';

    meaning: a string beginning with '07', followed by exactly
    9 alphanumeric characters. If they need to be digits, use :digit:
    instead of :alnum:.
    References here:
    [url]http://dev.mysql.com/doc/refman/5.0/en/regexp.html[/url]

    ciao
    gmax

    --
    _ _ _ _
    (_|| | |(_|><
    _|
    [url]http://gmax.oltrelinux.com[/url]
    Giuseppe Maxia Guest

Similar Threads

  1. help with a SELECT query
    By halex2000 in forum MySQL
    Replies: 2
    Last Post: July 30th, 08:34 PM
  2. Query of Query to select a title first letter
    By Conti in forum Coldfusion Database Access
    Replies: 2
    Last Post: March 18th, 11:42 PM
  3. Select query
    By Ad Bec in forum Coldfusion Database Access
    Replies: 2
    Last Post: October 10th, 06:00 AM
  4. Using < and > in a select query
    By Grynch in forum Coldfusion Database Access
    Replies: 3
    Last Post: April 18th, 03:55 AM
  5. Select box determines query...
    By Seth Buntin in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: February 17th, 07:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139