Home > database >  Palindrome judgment
Palindrome judgment

Time:04-22

God help me, the brain quickly exploded

CodePudding user response:

No matter what subject are you, since you asked the SQL version again, you use SQL to solve

 
Declare @ v nvarchar (Max)

The set @ v='abcde'

Select @ v, (case when @ v=REVERSE (@ v) then one else 0 end)

The set @ v='abcdedcba'

Select @ v, (case when @ v=REVERSE (@ v) then one else 0 end)

CodePudding user response:

reference 1/f, illiterate old gu response:
no matter what subject are you, since you asked the SQL version again, you use SQL to solve

 
Declare @ v nvarchar (Max)

The set @ v='abcde'

Select @ v, (case when @ v=REVERSE (@ v) then one else 0 end)

The set @ v='abcdedcba'

Select @ v, (case when @ v=REVERSE (@ v) then one else 0 end)


Great god I ask should not be so advanced, is only a freshman
  • Related