dan wrote:

> Hi there, quick and annoying SQL problem, was debating about whether to post
> it here or DBI, I figured DBI was for DBI related issues, and this is just a
> plain SQL problem.

So it should really be posted on an RDBMS list.

> Excuse me if I'm wrong though, but thought I'd ask
> anyway.
> I have an SQL statement as follows,
> SELECT * FROM memodata WHERE to=1 AND readdate=sent ORDER BY id ASC

Please put spaces in your condition clauses, there is nothing magical about
torturing the eyes.

In addition to the concerns Rob raised about using reserved words [you can
generalize this to say that generic names are just bad style anyway]  I would
suggest naming the fields you are taking.  Some SQL engines cannot address
fields that are not selectd by name.  The select * construct is for dumps, not
for analytical selects.

select sender, receiver, time, date form mailhistory where receiver =
$target_recipient;

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to