Skip to content
Advertisement

SQL – Compare 2 tables with dates [closed]

I have 3 tables with are the following:

I have the following data in the tables:

wpwh_veosoft_crm_st

Table st

wpwh_veosoft_crm_servicedeal

Table servicedeal

wpwh_veosoft_crm_price

Table price

If i have the following data:

table st

table servicedeal

i only want to see the row with id 13 from table price because its the closet date before my startDate 2018-11-01

Does anyone have an SQL that can solve the problem?

thanks in advance

Advertisement

Answer

You can join and filter with a correlated subquery:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement