How to write query for this given information???
I have table (employees) like this
Hire_date
Salary
04-jan-1991
2000
05-mar-1991
1300
12-sep-1991
2400
19-feb-1992
3000
17-apr-1992
1000
23-nov-1992
1200
25-jan-1993
1000
06-jun-1993
1200
I want to get output like this
Hire_date
Salary
Years in range
total
04-jan-1991
2000
05-mar-1991
1300
12-sep-1991
2400
01-jan-1991 to 31-dec-1991
5700
19-feb-1992
3000
17-apr-1992
1000
23-nov-1992
1200
01-jan-1992 to 31-dec-1992
4200
25-jan-1993
1000
06-jan-1993
1200
01-jan-1993 to 31-dec-1993
2200
give me some ideas guys
Without using analytic functions,
select
hire_date,salary,
decode(hire_date,null,extract(year from hire_date)) year_tag,
decode(hire_date,null,sum(salary)) total_sal
from
employees
group by grouping sets ((hire_date,salary,extract(year from hire_date)),extract(year from hire_date),())
Output
HIRE_DATE SALARY YEAR_TAG TOTAL_SAL
04-JAN-91 2000
05-MAR-91 1300
12-SEP-91 2400
1991 5700
19-FEB-92 3000
17-APR-92 1000
23-NOV-92 1200
1992 5200
25-JAN-93 1000
06-JUN-93 1200
1993 2200
13100
Similar Messages
-
How to write query for this in TopLink ?
I am doing a simple search in jsp where the search will the based on the choices chosen by user.
I had given 3 check boxes for those choices.
The problem is, query will be based on the choice or choices chosed by the user.
How to write query for this in TopLink ?
Thanks in Advance..
JayaganeshTry below solution, it is NOT best solution but might work:
Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
INSERT INTO @Questions
VALUES (1, 'Comment'), (2, 'Score')
DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
INSERT INTO @Answers
VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,A.AnswerText
FROM
@Questions Q
INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
UNION
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,Null
FROM
@Questions Q
CROSS JOIN @Answers A
WHERE
NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
Output
AuthKey | QuestionID
| QuestionText
| AnswerText
101 | 1 | Comment | hi!!
101 | 2 | Score | 4
102 | 1 | Comment | excellent
102 | 2 | Score | 5
103 | 1 | Comment | NULL
103 | 2 | Score | 6
104 | 1 | Comment | NULL
104 | 2 | Score | 8
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
How to write query for this scenario
Hi -
I have two table like this:
Question:
questionid questiontext
1 comment
2 score
Answer:
authkey questionid
questiontext answertext
101 1 comment hi!!
101 2 score 4
102 1 comment excellent
102 2 score 5
103 2 score 6
104 2 score 8
Here there are two question (score and comment) and answer is stored in answer table. there are case when there is no comment and only answer. but answer would always be there in answer table for each authkey.
I want to write the query that gives the result that if no comment is given for authkey then return null as answer. something like below:
Desired Result:
authkey questionid questiontext
answertext
101 1 comment hi!!
101 2 score 4
102 1 comment excellent
102 2 score 5
103 2 score 6
103 1 comment null
104 2 score 8
104 1 comment null
what query can i write to get the above desired result.
Thanks in advanceTry below solution, it is NOT best solution but might work:
Declare @Questions TABLE (QuestionID INT, QuestionText Varchar(100))
INSERT INTO @Questions
VALUES (1, 'Comment'), (2, 'Score')
DECLARE @Answers TABLE (authkey INT, QuestionID INT, questiontext VARCHAR(100), answertext VARCHAR(100))
INSERT INTO @Answers
VALUES (101, 1, 'comment', 'hi!!'), (101, 2, 'score', '4'), (102, 1, 'comment', 'excellent'), (102, 2, 'score', '5'), (103, 2, 'score', '6'), (104, 2, 'score', '8')
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,A.AnswerText
FROM
@Questions Q
INNER JOIN @Answers A ON Q.QuestionID = A.QuestionID
UNION
SELECT
A.AuthKey
,Q.QuestionID
,Q.QuestionText
,Null
FROM
@Questions Q
CROSS JOIN @Answers A
WHERE
NOT EXISTS (SELECT 1 FROM @Answers SubQry WHERE SubQry.AuthKey = A.AuthKey AND SubQry.QuestionID = Q.QuestionID)
Output
AuthKey | QuestionID
| QuestionText
| AnswerText
101 | 1 | Comment | hi!!
101 | 2 | Score | 4
102 | 1 | Comment | excellent
102 | 2 | Score | 5
103 | 1 | Comment | NULL
103 | 2 | Score | 6
104 | 1 | Comment | NULL
104 | 2 | Score | 8
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered. -
How to write query for this?
Hello ppl!
See, I am making a search application. I have a text field and a button on my screen. Now suppose i want to search for "abc", the search is succesful, but when i search for "a*", no results are shown.
So what should be query which will satify both the scenarios?you asking about wild card search in SELECT statements?
The following is the help on wild card search in SELECT statements
... WHERE CITY LIKE '%town%'.
This condition is true if the column CITY contains a string containing the pattern town.
... WHERE NAME NOT LIKE '_n%'.
This condition is true if the column NAME contains a value whose second character is not n.
<b>... WHERE FUNCNAME LIKE 'EDIT#_%' ESCAPE '#'.
This condition is true if the contents of the column FUNCNAME begin with EDIT_.</b> -
How to write SQL for this query
Hi, All
I have table which sample data are shown below
CLM_NO. CLM_RUN PARTY PAY_CD
2006213103246 2006085483 PA010193 3CO11
2006213103246 2006085483 PA010193 3CO17
2006213103246 0000000000 PA084113 2CO11
2006213103246 0000000000 PA000001 2RK11
2006213103246 0000000000 PA082822 3CO11
2006213103270 0000000000 PA000001 2RK11
2006213103270 0000000000 PA032456 3CO11
for each clm_no , if data only have zero the report must show pay_cd minimum value(2RK11) but when clm_run have both zero and nonzero data the report will show minimum pay_cd of record that have clm_run nonzero data(3CO11)
Thank you
MckaHi Mcka
Based on the example you have provided, we should have only the following two rows in the final result:
CLM_NO. CLM_RUN PARTY PAY_CD
2006213103246 2006085483 PA010193 3CO11
2006213103270 0000000000 PA000001 2RK11
The first line is displayed because even though there are 6 rows for CLM_NO 2006213103246, with a combination of zero and non-zero CLM_RUNS, we need to display the non-zero row containing the minimum PAY_CD.
The second line is displayed because both rows have a zero CLM_RUN and we need to display the row which has the lowest PAY_CD.
If this understanding sounds right to you then you need to create the following condition:
RANK() OVER(PARTITION BY CLM_NO ORDER BY CLM_RUN DESC, PAY_CD ASC) = 1
Can you follow what this is doing?
Basically, for each CLM_NO, identified by the clause PARTITION BY CLM_NO, we are ranking the combination of CLM_RUN and PAY_CD where the CLM_RUN is sorted in high to low order and the PAY_CD is sorted in low to high order. This will cause Discoverer to allocate an ascending range of numbers starting with 1, where 1 corresponds to the row you are looking for. If we create a condition such that this whole expression equals 1 then we must display only the rows that you want, with one row being displayed per CLM_NO.
Note: This works so long as the same CLM_NO cannot have two or more different CLM_RUN numbers where one of the higher CLM_RUNs has a lower PAY_CD than the other non-zero CLM_RUNs.
It also makes the assumption that for a given non-zero CLM_RUN there will not be two or more identical PAY_CDs. If this condition can exist then you could exclude duplicate values from the report. If you have never done this there is a checkbox called Hide Duplicate Rows on the Layout tab of the Edit Worksheet Dialog box.
Best wishes
Michael -
How to write query for shuttle box
hi
i am creating an shuttle box on my input page and need to write a query to display the selected columns in the shuttle box..
i have created the shuttle bottle and gave the static values in it , i can view my values but cannot understand how to give the condition which allows me to display the data
only for selected columns ...
Please Helpthank you for reply..
I am completely new to oracle apex...i think here there is a prcodure to get default values into the right side box, my question is , how do i write a query for all the items in the left side box columns when selected to right side, the data has to be displayed only for those columns...
i am looking for syntax of the query ...
For eg there 4 columns on the left hand side of the shuttle box
job_id
cluster_id
cluster_code
cluster_name
and i select just job_id and cluster_id to right hand side , i need to display data associated with only these 2 columns...
Please Help
Edited by: user12855387 on Apr 20, 2010 11:08 AM -
How to write code for this logic in a routine, very urgent --help me
hi all,
i want to apply this logic into one subroutin ZABC.
here i m giving my logic ,can any body help me in coding for this, this is very urgent, i hv to submit on wednesday.
4.1 Read the company code number BSEG-BUKRS from document line item.
4.2 Fetch PRDHA from MARA into GV_PRDHA where MATNR = BSEG-MATNR.
4.3 Fetch Business area (GSBER) from ZFIBU into GV_GSBER where (PRDHA = GV_PRDHA and BUKRS = BSEG-BUKRS) OR (PRDHA = GV_PRDHA and BUKRS = SPACE).
4.4 If business area match is found, go to step 3.9. Else continue.
4.5 If BKPF-BLART IN set ZVS_POSDT OR BKPF-XBLNR starts with I0*, execute steps below. Else, go to Step 3.6.
i. MOVE: BSEG-BKURS TO work area field WA_ZFIBUE-BUKRS,
BSEG-MATNR TO work area field WA_ZFIBUE-MATNR,
GV_PRDHA TO work area field WA_ZFIBUE-PRDHA,
BSEG-HKONT TO work area field WA_ZFIBUE-HKONT,
BSEG-GSBER TO work area field WA_ZFIBUE-GSBER,
BSEG-PSWBT TO work area field WA_ZFIBUE-PSWBT,
BKPF-BUDAT TO work area field WA_ZFIBUE-BUDAT,
SY-DATUM TO work area field WA_ZFIBUE-CREDATE,
SY-UZEIT TO work area field WA_ZFIBUE-CRETIME,
Fetch running serial number (WA_ZFIBUE-SERIALNO) from ZFICO. This number will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "ZFIBUE" and KEY1 = "SERIALNO". The actual serial number will be stored in the field VALUE1.
i. Insert WA_ZFIBUE INTO ZFIBUE.
ii. Send email notification to the user (if it is not already sent to user on the same posting date).
Use function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail.
Fetch email address and date of last email from ZFICO. These values will be stored in ZFICO with PARAMTYPE = "BPM030307", SUBTYPE = "EMAIL" and KEY1 = "<USERNAME>". The email address will be stored in the field VALUE1 and posting date in VALUE2. Once mail is sent, VALUE2 is updated with latest posting date (BKPF-BUDAT).
iii. Increment the running serial number and update ZFICO with new serial number.
a. GV_ SERIALNO = WA_ZFIBUE-SERIALNO + 1
b. Update ZFICO Set value1 = GV_SERIALNO
Where PARAMTYPE = "BPM030307" AND
SUBTYPE = "ZFIBUE" AND
KEY1 = "SERIALNO".
iv Move VDFT to BSEG-GSBER.
v. Exit routine.
4.6 Fetch MTART into GV_MTART from MARA where MATNR = BSEG-MATNR.
4.7 If SY-BATCH = INITIAL AND GV_MTART <> ROH, issue the error message - Maintain the mapping of product hierarchy <PRDHA> from article <MATNR> for <BUKRS>. Else, go to step 3.8.
4.8 If SY-BATCH <> INITIAL AND GV_MTART <> ROH, issue the error message - Maintain product hierarchy on article master. Go to step 3.10.
4.9 Move GV_GSBER TO BSEG-GSBER.
4.10 Exit Routine
plz give me reply asap --this is very urgent
thanks in advance
swathiHi Swathi,
If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop. -
How to write code for this logic, plz help me very urgent
Hi All,
i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
here i m giving my logic, can anybody send me the code related to this logic.
this is very urgent .
this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list if user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
fields of zfibue:
serailno = numc
bukrs = char
matnr = char
prdha = char
hkont = char
gsber = char
wrbtr = char
budat = date
credate = date
cretime = time
processed= char
processedon = date
processedby = char
mapped = char are belongs to above type data types
and seelct-optionfields: s_bukrs for bseg-bukrs
s_hkont for bseg-hkont,
s_budat for bkpf-budat,
s_processed for zfibue-processed,
s_processedon for zfibue-processedon,
s_mapped. for zfibue-mapped
parameters: p_chk1 as checkbox,
p_chk2 as checkbox.
p_filepath type rlgrap-filename.
1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: Invalid input for Company Code.
1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
1.3 If P_CHK2 = X, go to step 1.11. Else continue.
1.4 If P_CHK1 = X, continue. Else go to step 1.9
1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
1.7 Loop through GT_ZFIBUE where PRDHA = blank.
Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
IF sy-subrc = 0.
Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
Modify Table GT_ZFIBUE. Update Product Hierarchy
Endif.
Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
IF sy-subrc = 0.
Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
Move X to GT_ZFIBUE-MAPPED.
Modify Table GT_ZFIBUE.
Endif.
Endloop.
1.8 Modify database table ZFIBUE from GT_ZFIBUE.
1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section Inputs/Outputs (above).
Eg: LWA_ FIELDCAT -SELTEXT_L = 'Serial Number.
LWA_ FIELDCAT -DATATYPE = NUMC.
LWA_ FIELDCAT -OUTPUTLEN = 9.
LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
Append LWA_FIELDCAT to GT_FIELDCAT
Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = X in field catalog (GT_FIELDCAT).
b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a SAVE button.
1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ZFIBUESTAT) and I_CALLBACK_USER_COMMAND (=HANDLE_USER_ACTION) will also be passed to handle user events. Go to 2.14.
1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
1.12 Exit Program.
Logic to be implemented in routine Handle_User_Action
This routine will have the following interface:
FORM Handle_User_Action USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
ENDFORM.
Following logic will be implemented in this routine:
1. If r_ucomm = SAVE, continue. Else exit.
2. Loop through GT_ZFIBUE where SEL_ROW = X. Row is selected
a. IF GT_ZFIBUE-PROCESSED = X.
i. GT_ZFIBUE-PROCESSEDON = SY-DATUM.
ii. GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
iii. MODIFY ZFIBUE FROM work area GT_ZFIBUE.
Endif.
Endloop.Hi Swathi,
If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop. -
Classical report how to write code for this task
coding
Delivery Due List: This Report program generates list with details of quantity available, quantity planned, quantity delivered and quantity still to be delivered for sales orders and stock transport orders based on shipping pointHi,
Try to get TABLE and FIELD names from your senoir or functional consultants.
or
search the field names in the following tables...
VBAP
LIPS
VBRP.
Regards,
Billa -
How to write query for below requirement
Hi sir,
i have a table x have one column y which containing value like below
Y
a
b
c
d
I want out put like below kindly help me:
Y
a
d
c
bHi ,
Please check:
select y from (
select case when y='a' then 1 else 2 end no, y from table_x
) order by no asc, y desc
with table_x as(
select 'a' y
from dual
union
select 'b' y
from dual
union
select 'c' y
from dual
union
select 'd' y
from dual
select y from (
select case when y='a' then 1 else 2 end no, y from table_x
) order by no asc, y desc
Thank you -
How to write select query for this
Hi,
I had a html form and in the for i had drop down box and it needs to select multiple values from the drop down box. When i select multiple values then i have to write the SQL select statement query .
When i try to write the select statement and trying to run i am getting error.
select * from Table
where emo_no = '1,2,3'
this is how i write query please suggest me how to write query for selecting multiple values from the drop down box.
Thanksselect * from Table
where emo_no in ( 1,2,3)
for integer values
select * from Table
where emo_no in ('1','2','3')
for characters
If we talk about large scale applications that may have millions of records, I would suggest this.
declare @t table (v int)
insert into t (v) values (1)
insert into t (v) valves (2)
insert into t (v) values (3)
select *
from table
inner join @t t on table.emo_no = t.v
Using "in" for a where clause is not so bad for filtering on a few values, but if you are filtering a lot of rows and a lot of values (emo_no) the performance degrades quickly for some reasons beyond the scope of this.
This is just one solution, I'll through this out as well, instead of an in memory (@t) table, doing a disk based temp table (#t) and creating an index on the column "v".
create table #t (v int)
insert into #t (v) values (1)
insert into #t (v) valves (2)
insert into #t (v) values (3)
create index ix_t on #t (v)
select *
from table
inner join #t t on table.emo_no = t.v
drop table #t
Pardon any syntax errors and careful using a drop statement.
Sometimes in memory tables work better than disk temp tables, it takes some testing and trial and error depending on your datasets to determine the best solution.
Probably too much info ;-)
Byron Mann
[email protected]
[email protected]
Software Architect
hosting.com | hostmysite.com
http://www.hostmysite.com/?utm_source=bb -
How to write program for handling script ?
In script i have 2 pages.
In first page i have constant windows and variable windows.
In second page i have main window.
How to write program for this?Hi
You need to write a driver program. You need to use open form, then write_form to write data into various windows and then close_form to close.
As you don't want main window in the first page first try out just by having the window in the second page; i guess system will take care of it. As all other windows filled and if u start writing data in the main it'll go for next page.
If doesn't work have the window on the first page with the least hight and write a command
IF &SYST-PAGE& EQ 1
NEXT-PAGE.
ENDIF.
Then in the second page you can have the main window hight as per your requirement.
Here is an example
(1) Get customer data
TABLES: scustom, sbook, spfli.
DATA: bookings like sbook...
select * from...
(2) Open form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = 'PRINTER'
FORM = 'S_EXAMPLE_1'
DIALOG = 'X'
EXCEPTIONS
others = 1
(3) Print table heading
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADING'
TYPE = 'TOP'
WINDOW = 'MAIN'
FUNCTION = 'SET'
(4) Print customer bookings
LOOP AT bookings WHERE
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BOOKING'
TYPE = 'BODY'
WINDOW = 'MAIN'
ENDLOOP
(5) Close form
CALL FUNCTION 'CLOSE_FORM'
Regards
Surya. -
How to write Validations for RadioButton
Hi All,
in my Application , two RadioButtons and one submitbutton is there, in that
1. yes
2. no
both are radio buttons
when i click on submit button, without selecting any one of those radiobuttons ,
it shud display error message, this errormessage i have written in iwdmessage.
it shud show this error message, instead of displaying nullpointer exception.
how to write validation for this.
please help me.
regards
sushHi shushma,
Simply put a check that:
If(wdContext.current<YOUR_NODE>Element().get<YOUR_ATTRIBUTE_NAME> !=null){
else{
// Show the error messages
//Displaying the error message is very easy.
//You can report exception using the message manager API's. You will get this easily on SDN.
I hope this helps! if you need ay further help please let me know.
Thanks and Regards,
Pravesh -
How should i write a query for this?
Hi i give the follwing query to implement the result,
IT will gives you the result of one country machines information like Total machines failed machines and success machines of their count
Countyr Name CountryCode Total Machines Failed Machines and Succes machines and their perentage
IT ITALY
1000 20
980 98%
like these i want to display the 16 countyr machines information all country information in one palce like table format
i will give you the query to the below here it is the combination of powershell code also used here with sql code.
Code as Country
Name as Country
And below i mentioned OU in bold every where i will put the country code according to the country
like OU=FR
Select
'FR' as 'Code',
'FRANCE' as 'Name',
(select COUNT(*) from ADComputersInfo where
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
(select COUNT(*) from ADComputersInfo where
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
(select COUNT(*) from ADComputersInfo where
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
(select COUNT(*) from ADComputersInfo where
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
(select count(distinct(cn)) from ADComputersInfo where
(ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
and cn in (select name0 from v_R_System)
(select count(distinct(cn)) from ADComputersInfo where
(ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
and cn not in (select name0 from v_R_System)
select count(distinct(cn)) from ADComputersInfo where
(ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
and cn in (select name0 from v_R_System where Client0 =1 and Obsolete0 =0)
select count(distinct(cn)) from ADComputersInfo where
(ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Workstations_Indus,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com'
or
ObjectPath like 'LDAP://eur.gad.schneider-electric.com/CN=%,OU=Servers,OU=FR,OU=Countries,DC=eur,DC=gad,DC=schneider-electric,DC=com')
and cn not in (select name0 from v_R_System where Client0 =1 and Obsolete0 =0)
So here i pass the County code and country name and OU=FR(assigned country code )
so hw we can all these 3 values in all the query can give me the r8 query for this . And i will get the all 16 country information
Ineed exact query hw we can implement..........................................
I might be excepting lot from our side guys...
Thanks !
AdvancedHi
Can you simple post sample data + desired result? Always state what version you are using..
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to find the name of query for a given report
Hi All,
I am having the name of a report and i need to find out the name of query for that report . Plz tell me how to find out the name of the query for a given report.
Thanks.
Regards,
Pooja Joshi.Use this FM
RSAQ_DECODE_REPORT_NAME
This FM takes program name as I/P and gives Query Name as O/P.
This FM uses the structure AQADEF to fetch the data.
Hope this helps.
Regards
Vinayak
Maybe you are looking for
-
Datasource, POJO and java.sql.Blob
Hello, is "java.sql.Blob" a valid type for a POJO datasource ? I declared one but I just dit not succeed in rendering its jpg picture. My java code is quite simple : ReportClientDocument reportClientDocument = new ReportClientDocument (); reportClien
-
IMac unexpectedly shutting down
My iMac has begun to shut down unexpectedly, repeatedly. I've been struggling with this issue for two days now and so can describe the typical pattern of odd behavior. I use my computer in the office of my private English school. For several hours in
-
I found something wich seems a bug in error handling. I created a JClient application and I declared my error handler using JUMetaObjectManager.setBaseErrorHandler. It works normaly. I created a method wich I connected to the WindowClosing event. In
-
Start a BPEL process automatically all 30 seconds
Hello, I would to check all 30 seconds a database for changes. If that is possible with the DatabaseAdapter? And if so like this is done? Or if there are there still other possibilities. It should be also begun automatically all 30 seconds a BPEL pro
-
Strip Characters from String?
Hi, How can I strip off some characters from the end of a string? I am not very good at regular expressions but perhaps I may not need one? Here is the data first_name_510 last_name_2267 I need a function that will strip off everything from the right