July 12, 2012 at 10:15 am
I have this:
UPDATE table SET column = ELT(FLOOR(RAND()*3)+1, 'string1', 'string2', 'string3');
Just need something to add 2 more strings. So the output will be:
string1 string2 string3
string3 string1 string2
string2 string3 string1
...
I hope thats no utter gibberish and would appreciate any help.
Cheers
Bernard
July 12, 2012 at 10:21 am
bernard75 (7/12/2012)
I have this:UPDATE table SET column = ELT(FLOOR(RAND()*3)+1, 'string1', 'string2', 'string3');
Just need something to add 2 more strings. So the output will be:
string1 string2 string3
string3 string1 string2
string2 string3 string1
...
I hope thats no utter gibberish and would appreciate any help.
Cheers
Bernard
Sorry, but I have no clue what you are trying to accomplish. For one, what is this function ELT? It isn't one I am familiar with.
For better answers please provide the DDL for the table (CREATE TABLE statement), sample data, and expected results.
July 12, 2012 at 10:31 am
I guess this somehow landed in the wrong forum. :blush:
ELT(): Return string at index number.
Anyway that query returns one of the strings.
July 12, 2012 at 10:38 am
bernard75 (7/12/2012)
I guess this somehow landed in the wrong forum. :blush:ELT(): Return string at index number.
Anyway that query returns one of the strings.
ELT is MySql not sql server. I had to google it to figure out what you were talking about. I suspect you would have far better luck with an answer on a MySql forum instead of a sql server forum.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
July 12, 2012 at 10:39 am
ELT() is a MySQL function. Doesn't exist in T-SQL. This is a forum for MS SQL Server, so you will probably be better off on a MySQL site with this specific question.
Or are you using SQL Server, not MySQL, and looking for a T-SQL equivalent of ELT()?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply