Re: A little SELECT syntax

From: David N Murray (dmurray_at_jsbsystems.com)
Date: 10/26/03

  • Next message: Steffen Goeldner: "ANNOUNCE: DBD::ADO 2.76"
    Date: Sun, 26 Oct 2003 10:55:40 -0500 (EST)
    To: dan <dan@danneh.demon.co.uk>
    
    

    1) What's the error?
    2) Does your sql statement work in mysql (interactive mode)?
    3) What does "WHERE 1 AND ..." mean? IOW, what's the '1 AND' supposed to
    be doing?
    4) Start smaller when you are developing SQL statements that you feel are
    complex:
            - select * from memodata where readdate = sent;
            - select * from memodata where to=1 and readdate = sent;
            - select * from memodata where to=1 and readdate = sent order by
    id asc;
    Whent the last one works properly, paste it into your script.

    Dave

    On Oct 26, dan scribed:

    > Hi,
    >
    > I've got a database that stores small messages for a service, what I want to
    > be able to do is get all rows from the database where the columns "sent" and
    > "readdate" match, I have this, but it's erroring. Any pointers please?
    >
    > SELECT * FROM memodata WHERE 1 AND to=1 AND readdate=sent ORDER BY id ASC
    >
    > Many thanks,
    >
    > Dan
    >
    > P.S: Using MySQL, DBD::mysql, not sure if you need to know that, but saying
    > anyway ;)
    >
    >


  • Next message: Steffen Goeldner: "ANNOUNCE: DBD::ADO 2.76"

    Relevant Pages

    • Export fast, my code slow =[
      ... ODBC driver or the server (MySQL, ... I think the above code is sending an "INSERT INTO" SQL statement to ... The reason I posted this to the MSAccess group instead of MySQL/MyODBC ...
      (comp.databases.ms-access)
    • Re: MySQLdb select
      ... >>do the proper quoting for all parameters. ... > Looks like MySQL doesn't like the quoting, ... > Franz GEIGER ... What you are trying to do is generate the SQL statement dynamically - ...
      (comp.lang.python)
    • Re: Newbie to client/server
      ... > a SQL statement) ... which is the primary key of the table _place_. ... In MySQL databases, you often have to string up several queries like ...
      (comp.lang.python)
    • Re: Lost - Please help with a query
      ... Use the combo-boxes AfterUpdate to build your SQL statement (query) in code, ... Dim MySQL As String ... Dim whr As String ...
      (comp.databases.ms-access)
    • Re: SQL insert/update duplicate entries
      ... > The 'sequence' field is the one that I want to check for duplicates ... > and then increment the 'frequency' field by one. ... Are you sure that MySQL supports the latter SQL statement? ...
      (comp.lang.perl.misc)