Deenath Kumar Deenath Kumar - 2 years ago 65
SQL Question

this sql made me little complex situation

Hi sql'ers though am dealing with SQL from past 4 years. I encountered little complex situation today.

I have a mysql table with columns, id,movieid,Lang,comment, and timestamp so i want to render comment for a particular movie in which user can decide a range that from where to where he wants a comment for that particular movie but when i try the following query will not working out. So help me guys I'm stucked.

SELECT comment from aaa where movieid=2 and language='en' between6 to 10

Here basically I need to fetch from 6th comment to 10th comment from my aaa table (only for passed movieid parameter). All help will be appreciated.

Answer Source

As far I understand you need to fetch 4 comments in total (between 6th and 10th) so you want to use LIMIT for that, starting from 6th record:

    movieid = 2
AND `language` = 'en'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download