Help in Query(Urgent)
I have a query like below
Select name from name where Number = 10;
Name
Eric
Jelly
I need to display the result like
Name
Eric Jelly
ANy help plz
I suppose you could create a PL/SQL function that does this. You provide the function the search criteria, it opens and fetches from a cursor, building a string in the meantime, then returns the string.
SQL> select get_name_str('10') as name_str from dual;
Similar Messages
-
Hi ,
I have two tables "table1" and "table2".Structure of the both tables are below:
Table1:
CustomerId
CustFname
CustLname
Convertion_Date
Table2:
CustomerId
DFname
DLname
CustomerId is used for joins .
Now i need a query based on conversion_date.
If conversion_date <sysdate
then
select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
else
select CustomerId,DFname,DLname from Table2
End .
I need this functionality in a single query using case statement.
Please help ..
Thanks,
Preethi MRPreethi MR wrote:
Hi ,
I have two tables "table1" and "table2".Structure of the both tables are below:
Table1:
CustomerId
CustFname
CustLname
Convertion_Date
Table2:
CustomerId
DFname
DLname
CustomerId is used for joins .
Now i need a query based on conversion_date.
If conversion_date <sysdate
then
select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
else
select CustomerId,DFname,DLname from Table2
End .
I need this functionality in a single query using case statement.
Please help ..
Thanks,
Preethi MRIs this urgent homework? Or urgent something else work?
What exactly makes it urgent? -
hi......
i have the table with following structure.
Table name : master
id name v_value
1 ashok 1
2 balak 2
3 kathir 4
4 karan 8
Input:
6
Need output
id name v_value
2 bala 2
3 kathir 4
Query like
SELECT * FROM MASTER WHERE V_VALUE IN (<input value>) ;
if given input value 6 means, how to split the value into 4 and 2....
if given input value 12 means, how to split the value into 4,8....
like wise.... for all the combinations..... for the above table values.
if i give the input value 6 means, i need the query like
select * from master where v_value in (2,4).
is split the value is possible by user define function?
like
select * from master v_value in (userdefine_function(<input value>));
if possible means give the function code.
It is very urgent for my project....
Thanks,
S.Ashokkumar
India.Ohh...you made it very simple. how can we accomplish
the bitwise OR/XOR/...so on.They are all variations on the bitand:
SQL> var P1 number
SQL> var P2 number
SQL> exec :P1 := 4;
PL/SQL-procedure is geslaagd.
SQL> exec :P2 := 6;
PL/SQL-procedure is geslaagd.
SQL> select :P1 + :P2 - bitand(:P1,:P2) bitor from dual
2 /
BITOR
6
SQL> select :P1 + :P2 - 2 * bitand(:P1,:P2) bitxor from dual
2 /
BITXOR
2
SQL> exec :P1 := 3;
PL/SQL-procedure is geslaagd.
SQL> exec :P2 := 32;
PL/SQL-procedure is geslaagd.
SQL> select :P1 + :P2 - bitand(:P1,:P2) bitor from dual
2 /
BITOR
35
SQL> select :P1 + :P2 - 2 * bitand(:P1,:P2) bitxor from dual
2 /
BITXOR
35Regards,
Rob. -
Need help in query-Urgent Please
Hi I have the following requrement.
select x from t.
1
2
3
4
I have to insert all the distict combinations in two columns of another table. the oytpu shd be like below
select * from b;
1 2
1 3
1 4
2 1
2 3
2 4
3 1
3 2
3 4
4 1
4 2
4 3
I can write a query like below.
create table b as select t1.x,t2.x from a t1, a t2 where t1.x<>t2.x;
But the problem is my table Has 250 million records or even more than that.
Pls suggest the most efficient way.SQL> WITH yourtable AS
2 (
3 SELECT 1 x FROM dual UNION ALL
4 SELECT 2 x FROM dual UNION ALL
5 SELECT 3 x FROM dual UNION ALL
6 SELECT 4 x FROM dual
7 )
8 SELECT a.x
9 , b.x
10 FROM yourtable a
11 , yourtable b
12 WHERE a.x != b.x
13 ORDER BY 1, 2
14 /
X X
1 2
1 3
1 4
2 1
2 3
2 4
3 1
3 2
3 4
4 1
4 2
4 3
12 rows selected.
SQL> -
Hi
I am new to This Forum
I am doing my project in databases i.e writing the queries
I need some suggestions from you experienced programmers
I have the table with the fileds Sno,Close,Avg
after 10 th row i have to find avg of all closes form 1 to 10 and display as avg colum
in 12 th row i have to discard the colum value of close 1 and find the avg of close from 2 to 11
13 th row i have to discard the colum value of close 2 and find the avg of close from 3 to 12
when i am inserting the new row in the table ,i have to find the avg of 10 closes from this close value
like so on --------------------------------
for example
Sno close avg
1 11 null
10 123 null
11 231 avg(close(1 to 10)
12 211 avg(close(2 to 11)
13 123 avg(close(3 to 12)
can any one tell me how to write this query
Plz -------------Use :
avg(col) over (order by sno rows between 10 preceding and 1 preceding)But don't do it on each insert, just keep it up in an output query.
Nicolas.
Message was edited by:
N. Gasparotto -
Hi Guru's
Can you please help me query tunning.
Database Version : Oracle 11g - 11.2.0.3
select distinct corporation_name custer_name,
glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
F_Get_SELL_ID_STRING(SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
ship_buy.domain_name,
F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
f_get_exp_accrue_amt(ship_buy.shipment_gid,'SHIPMENT') Total_accrual_amount
from shipment ship_buy,
invoice inv,
invoice_shipment si,
--voucher v,
corporation corp
where corp.domain_name=ship_buy.domain_name
and corp.is_domain_master='Y'
and 1=1
AND ship_buy.domain_name like 'UPS/CP/DFP/%'
and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
--and V.INVOICE_GID(+) = inv.invoice_gid
--and ship_buy.domain_name = 'UPS/CP/VZNB'
and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
AND SI.INVOICE_GID = INV.INVOICE_GID(+)
and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
and SHIP_BUY.USER_DEFINED1_ICON_GID = 'ACCEPTED'
UNION
select distinct corporation_name custer_name,
glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
F_GET_SELL_ID_STRING( SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
ship_buy.domain_name,
F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
f_get_exp_accrue_amt(inv.invoice_gid,'INVOICE') Total_accrual_amount
from shipment ship_buy,
invoice inv,
invoice_shipment si,
-- voucher v,
corporation corp
where corp.domain_name=ship_buy.domain_name
and corp.is_domain_master='Y'
and 1=1
AND ship_buy.domain_name like 'UPS/CP/DFP/%'
and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
--AND INV.DOMAIN_NAME = 'UPS/CP/VZNB'
--and V.INVOICE_GID(+) = inv.invoice_gid
and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
AND SI.INVOICE_GID = INV.INVOICE_GID(+)
and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
and INV.USER_DEFINED1_ICON_GID = 'ACCEPTED'
GROUP BY corporation_name,SHIP_BUY.SHIPMENT_GID,SHIP_BUY.SERVPROV_GID,ship_buy.domain_name,inv.invoice_gid
ORDER BY CUSTER_NAME, BUY_SHIPMENT_GID;
And I generated the execution plan :
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 448 | 415 (2)| 00:00:05 |
| 1 | SORT UNIQUE | | 3 | 448 | 414 (87)| 00:00:05 |
| 2 | UNION-ALL | | | | | |
| 3 | NESTED LOOPS OUTER | | 3 | 384 | 57 (0)| 00:00:01 |
|* 4 | HASH JOIN | | 3 | 294 | 54 (0)| 00:00:01 |
|* 5 | TABLE ACCESS BY INDEX ROWID | SHIPMENT | 3 | 195 | 40 (0)| 00:00:01 |
|* 6 | INDEX SKIP SCAN | IND_SHIP_DOM_ICON | 54 | | 25 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL | CORPORATION | 4 | 132 | 14 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | IND_INVOICESHIP_SHP_GID | 1 | 30 | 1 (0)| 00:00:01 |
| 9 | HASH GROUP BY | | 1 | 192 | 356 (1)| 00:00:05 |
|* 10 | HASH JOIN | | 1 | 192 | 354 (1)| 00:00:05 |
| 11 | NESTED LOOPS | | | | | |
| 12 | NESTED LOOPS | | 1 | 159 | 339 (0)| 00:00:05 |
| 13 | NESTED LOOPS | | 145 | 13920 | 194 (0)| 00:00:03 |
| 14 | TABLE ACCESS BY INDEX ROWID| INVOICE | 145 | 5220 | 49 (0)| 00:00:01 |
|* 15 | INDEX SKIP SCAN | IDX_INV_TYP_ICON_NAM | 145 | | 17 (0)| 00:00:01 |
|* 16 | INDEX RANGE SCAN | UK_INVOICE_SHIPMENT | 1 | 60 | 1 (0)| 00:00:01 |
|* 17 | INDEX UNIQUE SCAN | PK_SHIPMENT | 1 | | 1 (0)| 00:00:01 |
|* 18 | TABLE ACCESS BY INDEX ROWID | SHIPMENT | 1 | 63 | 1 (0)| 00:00:01 |
|* 19 | TABLE ACCESS FULL | CORPORATION | 4 | 132 | 14 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
5 - filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
'syyyy-mm-dd hh24:mi:ss') AND "SHIP_BUY"."INSERT_DATE">TO_DATE(' 2007-01-01 00:00:00', 'syyyy-mm-dd
hh24:mi:ss'))
6 - access("SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED' AND "SHIP_BUY"."DOMAIN_NAME" LIKE
'UPS/CP/DFP/%')
filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND
"SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED')
7 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
8 - access("SI"."SHIPMENT_GID"(+)="SHIP_BUY"."SHIPMENT_GID")
10 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
15 - access("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
filter("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
16 - access("SI"."INVOICE_GID"="INV"."INVOICE_GID")
17 - access("SI"."SHIPMENT_GID"="SHIP_BUY"."SHIPMENT_GID")
filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
'syyyy-mm-dd hh24:mi:ss'))
18 - filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND "SHIP_BUY"."INSERT_DATE">TO_DATE('
2007-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
19 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
Statistics
246247 recursive calls
2 db block gets
1660067 consistent gets
13839 physical reads
0 redo size
592054 bytes sent via SQL*Net to client
6024 bytes received via SQL*Net from client
502 SQL*Net roundtrips to/from client
15296 sorts (memory)
0 sorts (disk)
7513 rows processedHmmm...why does this look familiar?
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
SHIP_BUY.INSERT_DATE > '1-JAN-2007'
Like I said in your other thread about this, these two lines need to be fixed and your function needs to be fixed so the return statement doesn't do an implicit date conversion.
Can't you see what that first line is doing? You're taking a character string, turning it into a date, then back to a character string.
If nothing else, these lines should be...
F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) <= to_date('31-JUL-2013', 'DD-MON-YYYY')
SHIP_BUY.INSERT_DATE > to_date('01-JAN-2007','DD-MON-YYYY')
(assuming insert_date is a proper date format, fingers crossed) -
Help me! URGENT cannot find my printer model on hp website - how do i know which cartridge to order.
Depend on which country you are in btw, for the US this should be 61 black and 61 tricolor. For most of europe this will be 301 black and 301 tri color. So to be sure tell me from which country you are.
Say "Thanks" by clicking the Kudos Star in the post that helped you.
Although I work for HP my posts and replies are my own
Please mark the post that solves your problem as "Accepted Solution" -
Need Help to query Lync Database for User Information
Need Help to Query the lync database to retrieve below user information.
1. SIP Address of the registered user
2. Phone Number configured to the particular account.
3. IP Address
4. Last Logged in time.
I am trying to pull the above information from rtc database for all the registered users. Please let me know if this is possible and it would be great if you can throw some light on what tables to look for the data. Thank You.Hi,
For SIP address and Phone number you can check RTC database.
IP Address:
You can refer to the link below to query IP address:
http://h30499.www3.hp.com/t5/Business-Service-Management-BAC/Monitoring-Lync-with-the-User-Registrations-Viewer-Free-NMC-tool/ba-p/5961497#.UtOU43mIrwo
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
Last Logged in time:
You can refer to the link below:
http://blogs.technet.com/b/dodeitte/archive/2011/05/11/how-to-get-the-last-time-a-user-registered-with-a-front-end.aspx
Best Regards,
Eason Huang
Eason Huang
TechNet Community Support -
How can i set dynamice for week on Selection screen..pls help me..Urgent
Hi..All
please Help me .. i am very confused..
i need to set a varient for week which is dynamic on selection screen.
b) Week from current week to current week + 2. (<b>Dynamic selection)</b>how can i set dynamice for week on Selection screen,,
how can i do this..i am alrady set dynamice variant for Date.. there is option for D.. but in case of week there is a no option.
pls help me..urgent
thamks in advance.
mayukhHi,
I think the way out is use the dynamic select option while setting up the varinat and use sy-datum to sy-datum+9 which should essentially serve the purpose.
While saving the variant, for that particular date field check the Selection variable checkbox, then Choose D
option and then choose current days + or - option from there.
Rgds,
HR -
hi experts'
i have to generate asset utilization report in webdynpro
inputs for report are some rfcs
i get result from rfcs
i need to float report i used bussinessgraphic object
its not interactive
if i go for tables
how to create tables with drill down inside table
how to set color for each cell of table depending on condition
please help me
its urgent
and send me code n linkHi Vani,
Your requirement has many things
1. How to call RFCs
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15 [original link is broken]
2. Once you have data, how to work with BusinessGraphics ?
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ba2db0e5-0601-0010-9790-e271902f2c38
(This docs contatins all the required info on webDynpro UIElements)
3.Tables
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#46 [original link is broken]
Regards,Anilkumar -
problem with connecting ipad 2 with crestron cp2e...help plss its urgent...
I hv a ipad 2 with mobile pro g connected with cp2e. when i pressed any button in ipad its connet with cp2e but after 4-5 sec one error comes (warning wifi was powered off while the device was in auto -lock(sleep)press connect to reconnect) when i pressed again its connected with cp2e. i am using netgear wireless access point . i also has been changed access point as well as updated ipad firmware bt problem is as it is .. pls help.Hi have you solved the issue ?
Cause I have the same problem.
Tnx -
i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent, i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent
Welcome to the Apple Community.
You can only wipe your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely. -
Plz help me its urgent i have iphone i dnt want my deleted texts my phone was jailbroken if i do restore widout backup should i jailbreak again ,should i unlock again,will the data of texts premantly erased plz answr me
Jailbroken phones cannot be discussed in an Apple forum. If you synced your phone with your computer the texts will be in the backup, so if you restore the backup you may get them back, but with a jailbroken phone it's anybody's guess what will happen.
-
i can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi.
i switched off all the security settings and all the firewalls.
i m unable to install any of the app on the ipad
so i saw the apple support and it said to update the older version of my ipad.
and niether am i able to download the update nor am i able to download any app and install it in my ipad2
i also tried to download an .ipsw file (ios5 update) from torrentz bt i am also unable to install from that as itunes rjects that file and gives an error. and also tries to delete that file. plz anyone help urgently. -
hi all,
i have a problem in my bsp page.
in my bsp page, there is a button which is clicked, a new pop up window will appear. after the pop up window closed the caller window will be submitted.
after submitted, the server side script ( ABAP Code in event OnInputProcessing & OnInitiallization will be run ).
in order to be able to do this, i used java script. and it's already works well.
the problem is : there is 1 record that the ABAP code in event OnInputProcessing is not run. I have set break points on one of code in event OnInputProcessing, but it seems event OnInputProcessing is not triggered. if i also put the break point in event OnInitialization, it will stop in the break point in event OnInitialization.
is there any clue why this happened ?
please help, it's urgent because it's happened in my production system
many thanks in advance
regards
eddhiehi Raja,
thanks for the respond.
the code is already works for 2 years and just 1 record of ... perhaps thousands record that used the same code.
for other record, it go to event OnInputProcessing
but just this 1 record it won't go to event OnInputProcessing.
any clue ?
please help
regards
Maybe you are looking for
-
Exchange subfolders do not sync
I recently started using my iphone to sync an Exchange email account through the default iOS mail app. I noticed that the exchange account subfolders rarely sync. Anybody else having this issue? How can I get them to sync? I am willing to downloa
-
Network security:LAN manager authentication level setting on GPO
Hi, We have a requirement from project team to change the one of the security setting on default domain policy for all computers in domain. Below are the security setting which we need to modify. computer configuration-->windows settings-->security s
-
Received fatal alert: handshake_failure!!
Hi all, I have to connect with a server via mutual authentication. I have to received a server certificate and send my client certificate, which I have stored in cacerts. This certificate is a class 3 certificate from verisign. If I try to connect fr
-
Weird Automatic Scrolling of Timeline
I am running Premiere Elements 11 on Windows 7, 64 bit, with all the latest updates. I'm getting some weird automatic scrolling of the timeline happening. When I hover the mouse pointer anywhere on the left side of the screen, (including over the "Fi
-
Starting individual web-apps in an appserver instance
I know this is against the J2EE spec but surely Sun did not expect 100 apps deployed in one JVM instance (even if it is load balanced) and expect all the apps to be restarted when I just want to restart one app. Is there a way to restart a single web