Jump to content


Photo

Question On Between Clause


  • Please log in to reply
1 reply to this topic

#1 Cnes

Cnes

    New Member

  • Members
  • Pip
  • 1 posts

Posted 10 September 2012 - 02:36 AM

Hi,

From the book, I learned that the below two queries should return the same result:

SELECT drink_name FROM easy_drinks WHERE main = 'peach nectar' OR main = 'soda';

SELECT drink_name FROM easy_drinks WHERE main BETWEEN 'P' AND main = 'S';

However, when I run the second query on the website, the result set doesn't contain the rows where main = 'soda'. Does anyone know why that is?

#2 carlosgg123

carlosgg123

    New Member

  • Members
  • Pip
  • 3 posts

Posted 13 May 2013 - 02:53 PM

Hi, the second query should be:

SELECT drink_name FROM easy_drinks WHERE main BETWEEN 'p' AND 't';

You have to use the letter after 's', see p. 108 example.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users