the mysql table below has two columns. how do i select only those rows on which the first 3 alphabets of name of column A matches with first 3 alphabets of name of column B ?
ColumnA ColumnB
nameA1 nameB1
nameA2 nameB2
nameA3 nameB3
nameA4 nameB4
Unsure if I understood question properly. Do you also want to look contents of ColumnA to contains alphabet characters to avoid spaces and numbers or something else? If yes then you might want to add http://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp to it.