Jump to content

LAs

Members
  • Posts

    7
  • Joined

  • Last visited

LAs's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. LAs

    String.format()

    exactly, after this post, i found this on other forum, but thanks anywhere. Just came here to leave agreement with you
  2. 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.
  3. LAs

    Sort using CASE and LEN

    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 ?
  4. LAs

    storing prices

    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.
  5. LAs

    Sort using CASE and LEN

    Holly crap.. seriously, thouht I was trying to do this trick, seems like no. We can close this thread.
  6. LAs

    Sort using CASE and LEN

    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, cup and 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?
  7. 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 ?
×
×
  • Create New...