Multiple queries in a single request

Dear Experts

In my application, I have four running queries which produces TRUE or FALSE, I want to do all these four motions in a single SQL QUERY and return TRUE or FALSE

create table customer

(

number of cust_id,

Number of Enrol_number

acc_num varchar2 (20).

acc_num_1 varchar2 (20).

e-mail varchar2 (20).

param_id varchar2 (20).

number of reg_id

VARCHAR2 (20) mobile

);

insert into customer values (101,5001,851276914587912,563214785369851,' [email protected]' 01, 45, "1234567890");

insert into customer values (102,5002,851276914587900,563214785369800,' [email protected]'02, 46, ' 1234567800');

insert into customer values (103,5003,851276914587901,563214785369700,' [email protected]'03 47, ' 1234567500');

Here are my four queries

Select cust_id as holders of the customer

where cust_id = 102 and Enrol_number <>5001 - returns true

Select cust_id as the name of

client where

(acc_num = 851276914587912 or acc_num_1 = 563214785369851)

and Enrol_number <>5002 - returns true

Select cust_id as places of

client where reg_id = 45 and param_id = 01

and UPPER (email) ='[email protected] ' and Enrol_number <>5001;            -Returns false because the conditions are not met

Select cust_id as fourthlevel of

client where reg_id = 45 and param_id = 01

and mobile = 1234567890 and Enrol_number <>5001 - returns false because the conditions are not met

Output of desire

------------------------

Bringing together disbarred Thirdlevel Fourthlevel

TRUE FALSE FALSE TRUE

I don't want a customer Id if poster, here we have to given to verify

Help, please

Dear Ricky007, if I could help you please mark as helpful or correct answer

SELECT

(SELECT

CASE

WHEN COUNT (CUST_ID) = 1 THEN 'TRUE '.

WHEN COUNT (CUST_ID) = 0 THEN 'FALSE. '

END AS BRINGING TOGETHER

OF ZCUSTOMER

WHERE CUST_ID = 102

AND ENROL_NUMBER <> 5001) bringing TOGETHER.

(SELECT CASE

WHEN COUNT (CUST_ID) = 1 THEN 'TRUE '.

WHEN COUNT (CUST_ID) = 0 THEN 'FALSE. '

END DISBARRED ACE

OF ZCUSTOMER

WHERE (ACC_NUM = 851276914587912 OR ACC_NUM_1 = 563214785369851)

AND ENROL_NUMBER <> 5002) REMOVED.

(SELECT CASE

WHEN COUNT (CUST_ID) = 1 THEN 'TRUE '.

WHEN COUNT (CUST_ID) = 0 THEN 'FALSE. '

END AS PLACES

OF ZCUSTOMER

WHERE REG_ID = 45

AND PARAM_ID = 01

AND UPPER (EMAIL) = ' [email protected]'

AND ENROL_NUMBER <> 5001) PLACES.

(SELECT CASE

WHEN COUNT (CUST_ID) = 1 THEN 'TRUE '.

WHEN COUNT (CUST_ID) = 0 THEN 'FALSE. '

END AS FOURTHLEVEL

OF ZCUSTOMER

WHERE REG_ID = 45

AND PARAM_ID = 01

AND MOBILE = 1234567890

AND ENROL_NUMBER <> 5001) FOURTHLEVEL

DOUBLE;

Tags: Database

Similar Questions

  • Group by returning multiple columns in a single request

    Hello

    Sorry to ask this simple question, I suppose, but here's my problem.

    I am building a query to get to say the smallest user_id of workers in society by Department.

    The query goes like:

    Select emp... Department,
    min (EMP.user_id)
    employee emp
    Emp.department group

    It gives me the smallest user by Department id, which is what I want. But how can I also get the name of this person?

    I know that the condition of 'min' distinguishes a single record (there are no two people with the same user_id in the Department).
    But how can I also get the name without turning the query above in a subquery that I would like to once again a link to the table of employees?

    I know that the following works, but I don't think it's the best option:

    Select v1.department,
    v1.user_id,
    Emp1.name
    employee emp1.
    (select emp... Department,
    min (EMP.user_id)
    employee emp
    Group emp.department) v1
    where emp1.user_id = v1.user_id


    This is just one example of data. This is the principle which I don't understand.

    Any advice would be much appreciated.

    Cyril

    Hi, Cyril.

    To find the name of the person who has the lowest user_id

    SELECT    department
    ,         MIN (user_id)   AS lowest_user_id
    ,         MIN (name) KEEP (DENSE_RANK FIRST ORDER BY user_id)  AS person_with_lowest_user_id
    FROM      emp
    GROUP BY  department;
    

    'MIN (name)' above means that if there is a link for the lowest user_id, you will choose the candidate with the first name.

    If you want to display several columns in the row with the lowest user_id, you must have an expression of 'KEEP (DENSE_RANK...)' separate for each column. In this case, you will find may be easier to use the RANK or the analytical ROW_NUMBER in a subquery, like this:

    WITH  sub_query  AS
    (
         SELECT  department
         ,     user_id
         ,     name
         ,     col2, col3, col4, col5
         ,     RANK () OVER ( PARTITION BY  department
                               ORDER BY          user_id
                        )  AS r_num
         FROM     emp
    )
    SELECT     *     -- or list all columns EXCEPT r_num
    FROM     sub_query
    WHERE     r_num = 1;
    
  • Update multiple columns from multiple tables in a single UPDATE request

    Hello

    I'm trying to figure if I'm heading in the right direction.

    I want to update multiple columns from multiple tables in a single UPDATE request. Also, I would like to update multiple columns in a table from the tables.

    Scenario 1

    UPDATE Table2, Table 3
    SET T2.Column1 = T1.Column1 
    ,T2.Column2 = T1.Column2
    ,T3.Column2 = T1.Column2
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T1.id = T2.id
    and T1.id = T3.id
    
    

    Scenario 2

    UPDATE Table3
    SET T3.Column1 = T1.Column1 
    T3.Column2 = T1.Column2
    ,T3.Column3 = T2.Column3
    ,T3.Column4 = T2.Column4
    FROM Table1 T1, Table2 T2, Table3 T3
    WHERE T3.id = T1.id
    and T3.id = T2.id
    
    

    Hello

    For scenario 1, you must write separate instructions UPDATE table2 and table3.

    To guard against someone else change one of these tables while you act so you can copy all relevant data in a global temporary table and update this global temporary table table3.

    ENGAGE only when two tables have been changed.

    You can write a procedure or an INSTEAD OF trigger to do all this.

    For scenario 2, you can reference many tables that you need when new table3.  It might be more efficient and simpler to use the MERGER rather than UPDATED.  For example:

    MERGE INTO table3 dst

    WITH THE HELP OF)

    SELECT t1.id

    t1.column1

    t1.column2

    t2.column3

    t2.column4

    FROM table1 t1

    JOIN table2 t2 ON t1.id = t2.id

    )             src

    WE (dst.id = src_id

    WHEN MATCHED THEN UPDATE

    SET dst.column1 = src.column1

    dst.column2 = src.column2,

    dst.column3 = src.column3,

    dst.column4 = src.column4,

    ;

  • Break with multiple queries

    I built a relationship with the data model and two requests. I set up the break-up on it. The two queries contain the Department and select it. The Department is the key to the outbreak. The breakdown by item in the bursting may be alone. So if I specify, for the split by element the Department in the first query, only the first request is divided by Department, but the second query is not distributed. Breaking for queries longer divide? How to divide multiple queries in the logic of failure?

    Can you help me please?

    Hello Martini,

    Using concatenated sql and select the single lines or datatemplate

  • scripts / block of multiple queries in a query from CF in Oracle

    Greetings:

    I am above all a MS SQL programmer and I wonder how to execute multiple statements within a block request unique cfquery. For example, on MS SQL, I can do multiple delete queries, or update and select a block of cfquery, but I get an error when I try to do this on ORACLE. Is there a way to do this on ORACLE?

    Thank you!

    Your best bet is to use multiple CFQUERY CFTRANSACTION tags tags if you want them to all be handled in a "block" or "session". Or, put all your SQL queries in a PL/SQL stored procedure.

    Phil

  • Merge multiple columns into a single column?

    Hello

    I need to perform queries dynamically and the return values. I need to retrieve the values of the queries in a single column only by concatenating multiple columns. I can't use the PL/SQL in my scenario.
    is it possible to run a query and the result will be extracted in a single column (multiple column values must be concatenated)?

    Thank you
    Raja.
    SELECT rtrim(extract(xmltype(REPLACE(column_value,'
    

    Check this box... Copy it directly to this

    Ravi Kumar

  • Manually to scan multiple Pages into a single PDF file.

    Gentlemen:

    My gear - 4620 HP all-in-One.

    Problem:

    I prefer to scan multiple pages into a single PDF file and save them on the hard drive manually.

    The ADF is twisting the pages that are saved in the PDF file.

    Please notify.  An upgrade of the software will be available for manual use set up of the

    pages on the glass?

    No other problems with the HP 4620.  I use Windows 7, 64 bit.

    Just reply to your convenience.

    PDF4ME

    PDF4ME,

    Watch it again once and document Scanning how-to - for Windows 7, I don't see that Preview Scan must be turned on to scan several pages.

    You can check again to see if you can get this works by following the instructions in the document.

    HP Officejet 4620 e-all-in-one printer support - scanning - Windows 7

    Click on the thumbs-up Bravo !

    It's a nice way of saying 'Thank you' for help.

    While I strive to reflect best practices of HP, I do not work for HP.

  • HP Deskjet 2540: Cannot scan multiple pages into a single PDF for printer Deskjet 2540 Windows 10

    I'm scanning several pages (5) in a single document.  I followed the instructions in the other answers to the questions - I chose the type of pdf file, I chose a less than 300 DPI resolution (I use the default value of 200 dpi), and I clicked on Preview (and not scan).  However, there was no option 'Add' page when you preview is posted.

    I don't know that I've scanned multiple pages in a single document, following the intructions of same, before moving on to Windows 10.  It is no longer possible with Windows 10?

    Thank you.

    Is this program, the program of HP that was loaded with the drivers and full software?

    You should have something like this with a sign at the 07:00 position.

  • HP5610xi: Using a HP 5610xi, how can I scan multiple pages into a single file?

    Using a HP 5610xi, how can I scan multiple pages into a single file?

    Hello

    Thank you for using the HP Forums.

    Can try this software:

    HP extended Scan

    FTP://FTP.HP.com/pub/scanners/HPScanExt/HPScanExt.msi

    Once it has downloaded and installed, go to start > all programs > HP > HP Scan extended > Run "HP Scan extended.

    This relevant resource will show you how to scan multiple pages into a single file:

    HP Officejet Pro 6960 series: scan a document of 6 pages 2 sides using the ADF

    Let us know if it works!

  • Track of multiple graphs on a single diagram of waveform with dynamic data types

    I'm putting multiple charts on a single diagram of waveform and data contract error. I was wondering if it has something to do with the fact that the dynamic data is used (I have had no problem with other types of data in the past). Does anyone know how to fix this? I have attached the following .VI. There will be a lot of. Live on the bottom which does not load, but they are not related to this problem.

    Thank you!

    Brian

    I don't know what you're doing now, but a part of your origianl code is simply ridiculous. Your DAQ assistant takes a single point. You convert that into an array. If you had converted into a scalar value (which is) first place, your graphics update would have been fine.

    If you want to remove the DAQ Assistant, and then select generate DAQmx code. You'll be a little more closely, but it seems that it generates a NChan DAQmx Read 1Samp instead of a 1Chan 1Samp DAQmx read.

  • HP Envy 4502: Scanning of multiple Documents in a single file on Mac OS 10.6/HP Envy 4502

    Can figure out how to scan multiple documents in a single file. I looked at the previous questions and answers, but I don't see a menu drop-down, click on when I select PDF. Have no idea how to proceed.

    Hi @JaneDeere,

    Welcome to the HP Forums!

    I noticed that you are trying to scan multiple documents in a single file on Mac OS 10.6/HP Envy 4502. I'm happy to discuss this issue for you!

    Please, try the steps in this guide, How to scan (OS X 10.6). Choose Scan with HP software, scroll and select, how to scan an original of several page in one file, and follow the instructions.

    I hope this is the answer you are looking for!

    "Please click the Thumbs up icon below to thank me for having responded."

  • scanning multiple pages to the single PDF using HP ENVY 4500

    The guide says scan of the computer (as opposed to scanning from printer).  I do that and still can't scan multiple pages into a single PDF file.  Is it still possible?

    Hi griff0530,

    I understand that you want to scan multipage documents into a single .pdf file using your HP Envy 4500, yes it is quite possible.  When you use the HP software on your computer, follow the steps below:

    1. loading the document.

    2. click on scan . An overview of the analysis is displayed (by default).

    Important : the Preview Scan function must be enabled for scan multiple pages into one file documents. Additional pages from the original are added for the single file in the Scan preview window.

    3. in the scan preview is displayed, do one of the following actions:

    Click the sign Plus () on the left side of the window to scan additional pages. If you do not use an ADF, you must load the next page of the document on the glass of the scanner to add to each additional page.

    4. click on Save to capture the scanned file, but leave open the HP Scan.

    5. click on done to capture the scanned file and close HP Scan.

    I found this great information here: how Scan: Windows 7

    If you are using any other operating system, it's ok the same steps apply. I hope that's what need you!

    Thank you

  • How do I? Scan multiple pages into a single document

    How to scan multiple pages into a single document?

    If you let us know the scanner you are using as well as the name of the software, it would be easy to suggest the measures.

    See the following links for the procedure:

    http://support.HP.com/us-en/document/c01282192

    http://support.HP.com/us-en/document/nps05123

    http://support.HP.com/us-en/document/bps03330

  • HP Envy 4501: Scanning multiple pages in a single document

    I'm trying to scan multiple pages into a single document.  I use an all-in-one HP Envy 4501 and 8.1 of Windows running.  I used to be able to do this at some point, but for some reason, lately I'm not able to.  I read the other posts that spoke of a sign "+" on the left side of the screen, but it isn't there for me.  Also, I can not just save the page and scan the other without having to save them in different files.  Please notify.

    Hello

    The HP software click on scan a Document or Photo and make sure that Scan to sow preview is checked.

    Reduce scanning in 300 resolution or a lower resolution and press Scan, then the Add button should reappear.

    Shlomi

  • Scan multiple pages to a single PDF on a Deskjet F4280

    I have a problem of how to scan multiple pages to a single pdf document using the Deskjet F4280. Help please...

    Please click on the following link

    http://support.HP.com/us-en/document/c01282192

    Hope this helps you.

Maybe you are looking for

  • Photos - a validation test!

    Hello I guess this may well been asked before but in a different way, but I just wanted to go through my understanding of the 'sync to devices' pictures little use iCloud photo library... Taking the simple example of say a Mac computer and an iPad on

  • where is the Clipboard and how to use it

    I recently bought a 'new' MacMini (2014 model) with El Capitan, OS X10.11.3 My questions: 1. where is the Clipboard, literally how to find it and how do I enter?  Never used before. Don't type "Clipboard" in give Spotlight help is not usable. 2. I th

  • 5530 ENVY: Can you change the live of HP Wireless channel?

    I have a HP ENVY 5530.  Can I change the channel default channel 6 wireless? Thank you.

  • Is the password required for the upgrade?

    When I bought my HP computer, I went to the premium version of what was their current line of portable computers for personal use. This computer is equipped with a fingerprint scanner that is managed by HP SimplePass. Let me clarify this now - I don'

  • RTM of Windows 8 core only iso language

    Hello I need assistance with the RTM of Windows 8 CoreSingleLanguage OEM:DM x 64 bit iso download tried to search but found nothing. If somebody made the download link please comment I really need that iso clean installation any comment will be appre