SQL Query for conditional selecting -


i have question how retrieve data 1 customer's order table (oracle) this:

id   customer cake          top    1    001      chocolate     cream 2    002      chocolate     jam 3    002      vanilla       cream 4    003      banana        cream 

i want know orders customers order includes chocolate cake.

the right result should

id   customer cake          top    1    001      chocolate     cream 2    002      chocolate     jam 3    002      vanilla       cream 

i 2 separate queries in sql, there way in single query?

many thanks!

you should use sub-query customers:

select * order customer in (   select distinct customer order cake = 'chocolate' ) 

Comments

Popular posts from this blog

ios - UITEXTFIELD InputView Uipicker not working in swift -

Hatching array of circles in AutoCAD using c# -