0

I'm new working with databases and i have the following question.

I have a table with the columns: input, output and type.
The column input and output are products ids and the column type only have 3 values 'techno','bio' or 'production'. I have 1000's of records.
Is it possible to do a query to find the inputs that have more than one record with 'production' type?

I work with SQLite3 on python. Thanks! :)

1 Answer 1

1

From what I understand, input column in your database table has product id and can be the same across several rows. If that's the case, then the query you're looking at should be something like this:

select input, count(type) from table_name where type = 'production' group by input having count(type) > 1
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.