-1

Is there a difference between:

  • "get product by id" and "get product from id"
  • "get product by name" and "get product from name"
  • 1
    You have accepted the answer too fast. I thought that you were talking about programming, about retrieving an object of type product. That context got nothing to do with sending or receiving an email. – RubioRic Nov 26 '18 at 10:27
  • @RubioRic I think yes – Konrad Nov 26 '18 at 10:28
1

Ok, now that you have specified that we are talking about programming. Probably you know about SQL, the universal language used to execute queries on a database. Its main sentence is a SELECT query

SELECT ATTRIBUTE
FROM PRODUCTS
WHERE CONDITION

I've highlighted the preposition from, it marks the place where the objects are stored. Which specific objects PRODUCTS we want to retrieve are filtered by the condition.

SELECT *
FROM PRODUCTS
WHERE id = 5

SELECT *
FROM PRODUCTS
WHERE name = 'Richard'

When we retrieve one specific object from PRODUCT using its id as condition, we say that we are selecting the object by id.

I don't know the exact programming language that you use but as an example, you can check Spring JPA library, that got structures like this

public interface CustomerRepository extends CrudRepository<Customer>, Long> {
     List<Customer> findByLastName(String lastName); 
}

findByLastName means that all retrieved Customers will have that lastName.

1

You can see this,may be you got the point why we use by or from.

Email received by you
Someone else sent an email to you. It was received by you.

Email received from you.
You sent an email to someone else. They received it from you.

Not the answer you're looking for? Browse other questions tagged or ask your own question.