sql query to exclude specific data from resultset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bips2005
    New Member
    • Jul 2008
    • 19

    sql query to exclude specific data from resultset

    i have got two tables,one customer with fields cust_id,email and another with field cust_id,domname ,expirydate. i have this query to combine these two tables to give me email and the expirydate as
    [code]
    $sql = "SELECT l.email,s.expir ydate from customer l, domain s where l.cust_id = s.cust_id ";
    [\code]

    i need to exclude those expirydates whose domname contains .np in the text.how can i do that
  • coolsti
    Contributor
    • Mar 2008
    • 310

    #2
    [code]
    $sql = "SELECT l.email,s.expir ydate from customer l, domain s where l.cust_id = s.cust_id and domname not like '%.np%' ";
    [\code]

    Unless I am overseeing something in your problem description, this is a very basic where clause structure.

    Comment

    Working...