1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

query

Discussion in 'SQL PL/SQL' started by bnramesh8, Jun 19, 2015.

  1. bnramesh8

    bnramesh8 Active Member

    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    80
    Hi All,

    I have one table,in that i have two col1,col2 columns

    col1 ------------------------ col2
    ------------------ --------------
    select count(*) from emp -------------- 10

    i need to compare the out put of col1 query with col2 value and if they are equal then display 'True' if they are not equal display 'False'.
    using plsql how can i achieve it?

    like count(*)=10 then 'T' else 'F'.
     
  2. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi,

    Your requirement is not clear.

    Is this meet your requirement?

    select decode(col1,col2,'True','False') req_output from your_table
     
  3. bnramesh8

    bnramesh8 Active Member

    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    80
    I give col1 val as select count(*) from table.and col2 as 10.the count val of col1=10(col2 val) then 'T' else 'F'.
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    I don't understand the 'logic' of this -- you need to explain the tables involved and the data stored in them.
     
  5. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    Is your requirement is to take the count of not null values from both the cols
    and return 'True' if the count is equal
    and return 'False' if the count differz
    ?!!

    Because count of records in tables means it includes col1 and col2.... Or U re speakin about count of records from different tables/?
     
  6. anji1010

    anji1010 Active Member

    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    75
    Location:
    hyderabad
    Hi, i have some questions please tell me the answers

    1. what is the difference between xml publisher and bi publisher?
    2. what is the difference between procedure,function,package
    3. how to get duplicate records from multiple columns?
    4.
     
  7. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation