Hi,
I have a table that holds two datetime columns. I am trying to find values
from this table that fall into specific time ranges, but am getting some
strange results. For example, if I try to find rows where the difference
between the two column is between 47 and 48 weeks, I get back a result
in this instance, what I'm looking for are the entries where they have
two entries in entries_tags with tag ids 5 and 6, instead of entries that
have either.
Thanks again,
Simon
On 27 September 2011 09:46, Simon Wilkinson wrote:
> Hi,
>
> I have a query where I'm using a
Hi,
I have a query where I'm using a left outer join to connect two tables,
entries and entries_tags, where entries_tags is a join table between entries
and another table, tags. In my query I am selecting values from the entries
table where the entries have any of the provided tags - WHERE
entrie
indexes.
Cheers,
Simon
On 19 January 2011 02:11, Steve Meyers wrote:
> On 1/18/11 10:22 AM, Simon Wilkinson wrote:
>
>> SELECT articles.* FROM articles INNER JOIN newsletters ON
>> articles.newsletter_id = newsletters.id INNER JOIN users ON users.id =
>> newsletters.user_i
Hi,
I am trying to optimize the following query:
SELECT articles.* FROM articles INNER JOIN newsletters ON
articles.newsletter_id = newsletters.id INNER JOIN users ON users.id =
newsletters.user_id WHERE users.id =12 AND MONTH(articles.created_at) = '12'
AND DAY(articles.created_at) = '5' ORDER B
Thank you, that did the trick.
Simon
On 11 January 2011 12:09, Steve Meyers wrote:
> On 1/11/11 9:31 AM, Simon Wilkinson wrote:
>
>> select users.id from users where users.id in (select newletters.user_id
>> from
>> newletters left join articles on newletters.id
Hi,
I have 3 tables that I am trying to search across, and could use some help
on how to structure the query. I have a users table, a newsletter table,
and an articles table. The newsletter table has a user_id column, and the
articles table has a newsletter_id column. A user can have multiple
n