In pure SQL, it's not possible I think. But you could create your own function like this:
SQL> desc t
Name Null? Type
------------------------------- -------- ----
ID NUMBER
VAL NUMBER...
Len Function
Returns a Long containing the number of characters in a string or the number of bytes required to store a variable.
Syntax
Len(string | varname)
The Len function syntax has these parts:
Part Description
string Any valid string expression. If string contains Null, Null is...
In your example you are left joining to the transactionindividuals table but are canceling that left join with an equality predicate in the Where clause.
In the method above he is maintaing a left join.
Not sure how your data is set up, but from your description you want this to be a true...
What platform is the datalength function valid for?
But that is the correct idea fairly easy, but the performance on a large table would probably have to be a full table scan. (In Oracle you can create function based indexes.)
And depending on the datatype you may have to perform a TRIM...
Also if you are using Oracle there are some analytic functions that you could look into.
With the above, you will notice that if you take off the group by function you are returning well over 100 rows. This query could be a very bad performer very quickly if you have very many rows in the...
With 2 assumptions you can possibly. BUT this is best done with a 3GL language such as RPG, COBOL, JAVA etc.
Not best for SQL.
1. You know the maximum possible characters that can appear for a number. (ie 3 has 5 characters associated to it)
2. You don't have &/or don't care if there is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.