Posts Tagged in join

“SQL query to match the data in the passed comma sepearted string”

There are several occasions when we have to match whether a passed collection of id is there in the database or not , in this case we can design the SQL in such a fashion that it checks for the id = (1,2,3), so for that we need to use IN operator.

Eg:
select * from table_name where table_name.id IN (array of integer or anything else)
Now here the array of integer or anything else should be in a comma separated manner like (1,2,3) or (‘asa’,’sa’,’sasa’)

Add comment March 26, 2008


Recent Posts

Tags

Active Record australian gp calendar date select capistrano capitalize debugging Debugging in rails edge rails formula 1 For those who dont want to update the prototype.js fun Fun baby fun google html in join javascript linus vs windows compatibility linux logging love song malaysian gp 2008 results melbourne migrations music mysql plugin poetry rails regexp regular expression results formula 1 opening race romantic poetry ror Ruby ruby on rails safe html sms song SQL string case handler for strings syantax syntax error for migrations on linux Text Area they can checkout 1.8.3 of the calender date select

Blogroll

Pages