Get maximum value in a field using SQL query
Hi,
I want to retrieve the row containing the maximum value for a particular field.
select max(fieldname) from tablename
How do I do this using database connectivity toolkit.
Shiva
Hello,
I figured out the answer. It was sql syntax.
Thanks for coming in here to help.
I created another post earlier because I had a little different question that pertained to fetch.vi. How do you get an array out from fetch.vi without creating error. I also made type an array also but it does not allow an array.
Thanks for your help.
By the way, how do I as the original poster get rid of a whole thread I created, especially if its a duplicate.
Similar Messages
-
Retreving Hexadecimal Values from a table using SQL query.
Hi,
I'm looking for a query to retreive Hexadecimal values contained in a column using SQL query.
The column contains the values of all types, alphanumeric, numeric and hexadecimal.
I need to retreive only hexadecimal values.
any help to me in this regard will be appreciated.
ThanksPresumably, you can be sure that any valid hex value is indeed MEANT to BE a hex value. For example the value 'ACE' is meant to be a hexadecimal value and not the word.
-
How to get tax break up of TDS using SQL query ?
Hi all,
We are developing a TDS report using SQL query
Report will contain VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount,
Bill Value 100.000,
TDS (2%) - 2.000,
TDS Surcharge(10% on TDS) - 0.2,
TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
We have developed this report which displays upto
VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount.
How to show tax break up of TDS in SQL query ?
Thanks,
With regards,
Jeyakanthan.Hi gauraw,
Thank for your reply.
I modified the query , pasted the query
as below in query generator,
Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
(((TDSAmt0.1) + TDSAmt)0.02) as 'TDSCess',
(((TDSAmt0.1) + TDSAmt)0.01) as 'TDSHCess'
FROM OPCH T0 INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
on clicking execute its showing error message invalid column
name 'TDSAmt'.
With regards,
Jeyakanthan -
Assigning values to 2 fields using sql statement
db11g , apex 4.0 and firefox 24 ,
hi all ,
i am trying to follow this tutorial to assign values to 2 items on a page using sql statement ,
and i am using the same sql statement the tutorial uses
select d.loc location, count(e.empno) num_employees from dept d, emp e where d.deptno = e.deptno(+) and d.deptno = :P3_DEPTNO group by d.loc -- btw , what does the "+" sign mean?
after the e.deptno in the where condition .
but i am facing this error
1 error has occurred
Wrong number of columns selected in the SQL query. See Help of attribute for details.
and it does not work with two columns in the select statement under any conditions , i tried to remove the group function and the group clause ,
it does not work unless i use only one column in the select statement ??
thanksPars
And how exactly is this rewrite of the sql statement resolving the OP's issue.
You are still using more than 1 column which will still result in the error message:
Wrong number of columns selected in the SQL query.
As mentioned in my earlier post APEX 4.0 (the version the OP is using) does not handle a sql statement with multiple columns for the dynamic action Set Value.
Which means the fastest and simplest solution is splitting up the dynamic action in multiple Set Value actions.
Using this plugin or upgrade to a newer apex version would also be a possibility.
Nicolette -
Multiple Value in additional fields using SAP Query
HI All,
I have a question related additional field in SAP Query. I tried to create report about PR and PO using SAP Query. Since one PR can be converted to multiple PO, I decided to create additional field
po_1
to display the value of PO that related to the PR. But I meet problem when I want to show several PO number in additional field
po_1
, I couldn't look the way to solve this problem. Can anybody help me? Just for info, I assign value to additional field
po_1
in record processing part.
Thanks....HI,
IN SQ02, IF table is already in JOIN, just click on the PLUS sign to expand the strcture.
All the field showing Plus sign in the strcture are selected in your query and with MINUS sing are no selected.
So you have to just click on the MINUS sign for the field you want to use through table field.
Generate the query and execute thriugh SQ01.
If you want to add some other field which is not a part of JOIN,
then click on EXTRAS Button shown in the MENU option.
Click on Create button and system will ask abt the additional field.
Regds,
Anil -
Getting run time value on form field by sql query and function
Hi All,
we have below requirement -
create a form with fields as below -
KRA_Type Grade Weightage Start Date End date
Functinal E2 30 1-Jan-2010 1-jan-2011
Organizational E2 70 1-jan-2010 1-jan-2011
lov of kra_type has 2 values (Functinal, Organizational). requirement is to validate Weightage field such that for same grade :- Fuctional Weightage + Organizational Weightage = 100.
please suggest on how to approch this.
Thanks,
Sam Dthis is not related to FORMS at all......
1) create a database function which take grade parameter and return the total weightage.
2) use it on when-validate-item trigger to validate
create or replace function get_grade_weightage(p_grade varchar2)
return number
is
v_grade number;
begin
select sum(Weightage)
into v_weightage
from mytable
where grade = p_grade;
exception when no_data_found then
return 0;
end;
select get_grade_weightage(:grade) into v_weigtage from dual;
if :current_weigth < v_weightage then
-- do something
else
--do something
end if;Hope it helps
plz mark the answer as correct or helpful if it is -
Finding minimum value in each row using dynamic query
need to find the minimum and maximum value from each row using dynamic query
[from curr] will be given as input
TukyDECLARE @t TABLE(a INT,b INT,c INT);
INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
SELECT *
, ( SELECT MAX(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS MaxVal
, ( SELECT MIN(val)
FROM (VALUES (a)
, (b)
, (c)
) AS value(val)
) AS MinVal
FROM @t;
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 -
Need to get the values from "Signed" field from PDF form.
Hi,
This is Dinesh. I am PHP Developer. My issue is "I am not able to get the value of "signed" field from the PDF form when the form has been submitted.". I want to get the Digital Signature value of that field and i need to store it in the DB.
Please help me here Or Please forward this issue to any of the PHP developer who solved this issue and let me know.
Thanks & Regards
DineshHi Vikas,
you can use this badi MRM_WT_SPLIT_UPDATE, the method will be WHTAX_SPLIT_UPDATE
in this badi please see the importing and exporting parameters, you will get the values of withholding tax code as TE_RBWS in export parameters.
Please search in google or SCN you will get how to use it. -
How to get the value of the field 'KOMP-NETWR' in Pur.
Hello everyone,
how do i get the value of the field 'KOMP-NETWR' in the purchase order.
thanks
ArnaudHi,
Try this code similarly for komp
REFRESH i_komv.
CLEAR i_komv.
CALL FUNCTION 'PRICING_REFRESH_TX'.
CALL FUNCTION 'REFRESH_TAX_TABLES'
EXPORTING
LIVERY =
LOOP AT i_ekpo INTO wa_ekpo.
wa_taxcom-bukrs = wa_ekko-bukrs.
wa_taxcom-budat = wa_ekko-bedat.
wa_taxcom-bldat = wa_ekko-bedat.
wa_taxcom-waers = wa_ekko-waers.
wa_taxcom-hwaer = wa_ekko-waers.
wa_taxcom-kposn = wa_ekpo-ebelp.
wa_taxcom-mwskz = wa_ekpo-mwskz.
wa_taxcom-wrbtr = wa_ekpo-netwr.
wa_taxcom-xmwst = 'X'.
wa_taxcom-lifnr = wa_ekko-lifnr.
wa_taxcom-ekorg = wa_ekko-ekorg.
wa_taxcom-matnr = wa_ekpo-matnr.
wa_taxcom-werks = wa_ekpo-werks.
wa_taxcom-matkl = wa_ekpo-matkl.
wa_taxcom-meins = wa_ekpo-meins.
wa_taxcom-mglme = wa_ekpo-menge.
wa_taxcom-mtart = wa_ekpo-mtart.
wa_taxcom-land1 = wa_ekko-lands.
wa_taxcom-ebeln = wa_ekpo-ebeln.
wa_taxcom-ebelp = wa_ekpo-ebelp.
CALL FUNCTION 'CALCULATE_TAX_ITEM'
EXPORTING
i_taxcom = wa_taxcom
IMPORTING
e_taxcom = wa_taxcom
TABLES
t_xkomv = i_komv
EXCEPTIONS
mwskz_not_defined = 1
mwskz_not_found = 2
mwskz_not_valid = 3
steuerbetrag_falsch = 4
country_not_found = 5
OTHERS = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
clear wa_taxcom.
ENDLOOP.
LOOP AT i_komv INTO wa_komv.
CASE wa_komv-kschl.
*EXCISE DUTY
WHEN 'JMOP'.
v_jmop = v_jmop + wa_komv-kwert.
endcase.
endloop.
Hope this might be of some use.
Regards,
sirisha -
How to get the values of an Array using JSP Tags
Hey guys,
I need some help. I've splited a String using
fn:split(String, delim) where String = "1,2,3,4" and delim is ,
This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
Any help would be highly appreciated
ThanksThe JSTL forEach tag.
In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
<c:set var="list" value="1,2,3,4"/>
<c:forEach var="num" items="${list}">
<c:out value="${num}"/>
</c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string. -
hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application
Hi FIROZ
TENNALI
Is this still an issue, or can we close the thread?
* closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
Ronen Ariely
[Personal Site] [Blog] [Facebook] -
How to show the VALUE as the Column Header using SQL query?
Hi
I have a requirement to show the picked value as the column header using SQL query.
Example:
======
SELECT EMPNO FROM EMP
WHERE EMPNO=7934;
Result Should be:
7934
7934I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
SQL> set verify on
SQL> def e = 7934
old: SELECT empno "&&e" FROM emp WHERE empno = &&e
new: SELECT empno "7934" FROM emp WHERE empno = 7934
SQL> SELECT empno "7934" FROM emp WHERE empno = 7934
7934
7934
1 row selected. -
How to get this output using sql query?
Hi,
How to get this output using sql query?
Sno Name Age ADD Result
1 Anil 23 delhi Pass
2 Shruti 25 bangalor Pass
3 Arun 21 delhi fail
4 Sonu 23 pune Pass
5 Roji 26 hydrabad fail
6 Anil 28 delhi pass
Output
Sno Name Age ADD Result
1 Anil 23 delhi pass
28 delhi passHi Vamshi,
Your query is not pretty clear.
write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
Regards,
Kannan -
How do i get the value of that field
in JSP i have a field like below..
<input type="hidden" id="grpId<%=Index%>" value="<bean:write name='GrpList' property='groupId'/>"/>
In Action class , how do i get the value of that field (i.e id) ?
String value =reques.getparameter (//what ??);i dont want to change the jsp.
concern is , as the name of the id is dynamic .....so can i get the value in the Action class ?
is there any trick exists ?
I will try not to change any jsp code but will do changes in Action class
Message was edited by:
Unknown_Citizen -
Help Required -- Can we use SQL Query to READ data from SAP MDM Tables
Hi All,
Please help.........
Can we use SQL Query to READ(No Creation/Updation/Deletion just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
Thanks in Advance
RegardsAll the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
BR,
Alok
Maybe you are looking for
-
Managing PDF's in iTunes for iBooks is difficult.
Managing PDF's in iTunes for iBooks is difficult due to the names of the files I'm working with. The PDF will have a burned-in name, yet I want to rename the files in Windows to make them easier to find (iBooks renames the files ON THE FLY when open
-
Hi,12.1(1) does not support the the T1/E1 VWIC-1MFT-G703 module I was told an upgrade to anything above 12.1(1)T should solve the problem. My question is would I need to pay for this upgrade? Thanks ahead. cheers
-
Hi, Can some one tell me if there is any way to took at all the SAP FI or CO tables exists, available in the system Thanks, Nivi
-
How to set enviroment variables for Inso Filter
Hi everyone, I want to convert word documents to html using CTX_DOC.Filter.According to the documentation,I know I neednot set the 'Inso Filter'in the preference when creating index,but I must set enviroment variables for Inso Filter. I found the fol
-
Account Assignment from Material Master or Goods Receipt Document..
We are on ECC 6.0 instance. For Vendor Cash Discounts we have all the postings going to a default cost center set up as the default account assignment in the cost element master. Because of the default cost center, the postings are going to the prof