LAs
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by LAs
-
-
Hello guys, i need some basic info here. I need to build string, which must be builded into "'%name%'", when name is a variable.
Using concat, its easy to do that:String myString = "'%" + name + "%'";how to do that with String.format() ?I`m trying to do like: String myString = String.format("'%%s%'", name); << it appears a problem with "%'" tag. how to avoid that ? How to use double %`s in the quotas ?Any suggestions ?
Linas.
-
Ok guys, need to wake up this thread again.
When i`m using sorting method with "order by case" and when ... then [number], i can use only 255 arguemnts in this state. The words like "when" "then" are described as variables (am i write?). Ok, so how to avoid those arguments limit ?
What kind of trick do you know and using, guys ?
-
What kind of question is that?!
It depends, how big your price value could be.
Use float, in that case, you will be able to hold price value with cents.
-
Holly crap.. seriously, thouht I was trying to do this trick, seems like no.
We can close this thread.
-
You can order further by LENGTH(CustomerName).
And where should i put this function ? Because i was trying to put it everywhere, still doesnt work..
Should i put it smth like:
SELECT * FROM Customers ORDER BY CASEWHEN CustomerName LIKE '%a%' THEN 1 ORDER BY LENGHT(CustomerName)WHEN CustomerName LIKE '%b%' THEN 2 ORDER BY LENGHT(CustomerName)ELSE 3 ORDER BY LENGHT(CustomerName)END
I mean, if i have data like:"house""cup""apartament""yard""bell""ben"and in my order (without sorting by lenght) it appears like:apartament, yard, bell, ben, house, cup.if i put selected data in sectors, by which case it was selected, it would look like this:(1 order): apartament, yard, ball(2 order): bell, ben(3 order): house, cupand i need to sort them by length in DESC order, so it should look like this:(1 order): ball, yard, apartament.(2 order): ben, bell.(3 order): cup, house.so all selected data should appear like:ball, yard, apartament, ben, bell, cup, house.how to do that with case and order by length? -
Hello guys, i need some experienced info here.. i need to sort selected data, thats why i used case like:
SELECT * FROM Customers ORDER BY CASEWHEN CustomerName LIKE '%a%' THEN 1WHEN CustomerName LIKE '%b%' THEN 2ELSE 3END
Everythings fine here, but I need to sort each sector (1, 2 and 3) seperately by CustomerName`s lenght. How to do that?
any ideas ?
String.format()
in Java/JSP/J2EE
Posted
exactly, after this post, i found this on other forum, but thanks anywhere. Just came here to leave agreement with you