Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012
    Posts
    91

    Unanswered: How can I get a lot of 'OR' in one query

    Is it possible to execute a single query with many conditions OR?
    Code:
    SELECT SUM(WARTOSC) FROM WARTPLN WHERE FV=1 OR FV=2 ... etc
    Values for a column FV i get from this query:
    Code:
    SELECT ID FROM FVNAG
    In the latter query, there are many records and I can not connect to the first query.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Code:
    select sum(wartosc) 
    from wartpln 
    where fv in (select id from fvnag)
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Jan 2012
    Posts
    91
    Thaank You

Posting Permissions

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