I have a problem with SQL query. In one table I have columns with names id and subid. Some of the product connects to other via subid in the same table. Example: