otuatail Posted October 24, 2008 Share Posted October 24, 2008 Hi not sure if this will work, but I am trying to pulll an email address from a table. because some emails are very long they mess up my table layout. I can use left(Email,14) as EmailShort to cut it down. If I could break it at the @ sign I could have the email on wrapped. is there a command that can get this Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/129941-difficult-sql-command/ Share on other sites More sharing options...
mrmitch Posted October 24, 2008 Share Posted October 24, 2008 Just add in the INSTR() function to find the index of the @ symbol on each row. left(Email,INSTR(Email,'@')) same as doing INSTR(Email,'@') as index, left(Email, index) as EmailShort Mitch Quote Link to comment https://forums.phpfreaks.com/topic/129941-difficult-sql-command/#findComment-673707 Share on other sites More sharing options...
mrmitch Posted October 24, 2008 Share Posted October 24, 2008 You could also use LOCATE() Quote Link to comment https://forums.phpfreaks.com/topic/129941-difficult-sql-command/#findComment-673821 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.