Home > database >  SQL data query, urgent! Stick!
SQL data query, urgent! Stick!

Time:10-18

Customers, sales id, in
Good navigation, 869, 201605
Far 869 201605
Gaozhou county, 869, 201605

Good navigation, 888, 201605
Far 888 201605

As shown above, there are tables A, there are two fields (customer, sales id), how to use the SQL query is good three customer name: (if the input air, far, gaozhou county) and in 201605 the query the sales id of 869 3 records, if only input two good customer: (navigation, via far) and in 201605, the query of sales with id 888 2 record
That is to say, according to input the customer name, sales of whether to list retrieval has the same id, if there is the same, the query of this a few records out!
I am using PB6.5

CodePudding user response:

If your group by sales ID is three having equal to 3 if it is 2 having equal to 2 anyway, thinking is like this.
  • Related