Hello everybody, I am trying to insert in the letter field the first letter of the FILEDX's content, How can i do it???
Any ideas is most appreciated, thanks
Check out Substr/substring()
Thanks for your swift reply rguy84, i will check it now
this will chop the strings up, you'll still have to insert them.
you are right, but when i chop the characters and get, how can i deal with it to insert it in the second field, please if you have idea
SELECT SUBSTRING('artist_name',1,1) this is it what i was looking, now i will try to find out how to insert it into the second field, if you have any idea while mine goes well its most appreciated, with lots of thanks
INSERT INTO tabl_name('firstLetter')
Thanks,Yes infact this worked with me too
insert into tbl1 (letter)SELECT SUBSTRING('field',1,1)from tbl2
But now i will do compare using where field's ID = same ID to be inserted respectively
And also i want to use UPDATE instead of insert because some fields contains some data, hope if you have any suggestions, with my infinite thanks
SET letter = SUBSTRING(field, 1, 1)
i should think that a relatively germane question is why would you want to do that?
Also i have checked this one it works
SELECT LEFT(FIELD, 1)FROM TABLE
UPDATE TABLESET letter = SUBSTRING(FIELD, 1, 1)where id=id2
With this we did it, same thanks to all of you guys for today we have solved our problem and we achieved our duty... thanks AGAIN
Thanks so much, that helped me lot
Yes because I was in a need to put that first letter in a field that was requesting the letter:)
why would you want to have a separate column containing the first letter only?
Well you're right, this letter appears when its categorized by letters
So why don't you group them by distinct values of the results dynamically. Ex: You have the results Ryan, Rudy, Guido. I am assuming you want like a a-z list. Currently you'd get R,R,G, which R, G would be cleaner.
It's not working in this manner, only this field should appear with a letter, that was the aim;)