0
How to find minimum and maximum length name in a table with there respective size using sql
You can write two queries separately
13 Respuestas
+ 2
Yes got it. Check this once.
With Minimum length :-
Select * from (
Select top 1 Name, LEN(Name) Name_Length from Table_Name where Name IS NOT NULL AND LEN(Name) > 0 Order By Name_Length ASC, Name ASC) TblMin
With Maximum length :-
Select * from (
Select top 1 Name, LEN(Name) Name_Length from Table_Name Order By Name_Length DESC, Name DESC) TblMax
+ 1
Top work in SQL, limit work in Oracle. I checked and verify in SQL
Edited:-
Top work in SQL, ROWNUM works in Oracle. I have checked and verify in SQL Management Studio.
+ 1
What happened with this way?
0
Your question is not clear.
0
How to find a name in any table with maximum length (means maximum character ) and also retrieve that name from the table
Now you got it?
0
I think top keyword doesn't work in oracle
0
By the way thank you i will inform you after checking it on my pc
0
Is there any other way to find it
0
It is not working in my laptop
This query is throwing an error "windows specification is missing for this function"
0
And limit keyword doesn't work in oracle it works in mysql. I have tried it
0
Sanjay Tiwari But in this query there is no function. Which DBMS you are using?
It's working on SQL management studio.
ROWNUM works in Oracle
TOP works in SQL
LIMIT works in MySql
0
I am using oracle 11g express edition
0
Can you please write it according to oracle's syntax