Results 1 to 3 of 3

Thread: have more then one value inside the select like in mysql

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    have more then one value inside the select like in mysql

    Select * from table where FeeType like ('Comp Fee Doposit%','Cont Fee%') is not working ?
    it looks like the select like can use Select * from table
    where FeeType in('a','b','c')
    ________
    Ferrari 248 f1 specifications
    Last edited by sql; 03-06-2011 at 02:15 AM.

  2. #2
    Join Date
    Jan 2010
    Posts
    37
    I am not sure about mySQL's implementation of SQL, but I know with MS SQL you cannot compare two fields with one like operator. You would have to use logical comparison operators to compare against more fields.

    ex:

    Select * from table where FeeType like 'Comp Fee Doposit%' or FeeType like 'Cont Fee%'

  3. #3
    Join Date
    Jul 2003
    Posts
    421
    in mysql you can use
    and (FeeType like'Cont Fee %' Or FeeType ='Comp Fee Doposit')
    ________
    Herbal Health Shop
    Last edited by sql; 03-06-2011 at 02:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •