Re: Subscription Suspensions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 31, 2012 at 6:35 PM, Ron Piggott
<ron.piggott@xxxxxxxxxxxxxxxxxx> wrote:
>
> Hi Everyone.
>
> I manage an e-mail list.  I am trying to add a new function into it: suspensions.  The idea is that someone wouldn’t have to unsubscribe.  Instead there would be a record of their suspension in the table member_subscription_suspensions and their account wouldn’t be included as a database query result when sending out the daily e-mail.
>
> There are three tables: Profile of the subscriber, subscriptions and subscription suspensions:
>
>
> How do I change this query to exclude any one who has a suspension record for “today”. IE CURDATE()
>
> Thanks for your help.  Ron
>
> Ron Piggott
>

Hi Ron,

I'm not sure why you posted your question here, it has no relation to
PHP whatsoever. And while you're not specifically asking, you cannot
assume people will start to write SQL for you.

It would've made sense if you mentioned what database you're using.
Some databases support the EXCEPT operator in SQL, though it seems
that the most popular one, MySQL, does not support it.
You can achieve the same with LEFT JOIN. Wikipedia has an example[1]
on how to replace the EXCEPT operator on databases that don't support
it.

Hope this will help you get started.

- Matijn

[1] http://en.wikipedia.org/wiki/Set_operations_(SQL)#EXCEPT_operator

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux