samples table
id, A, B 1, 1, 1 2, 1, 2 3, 1, 3 4, 1, 3 5, 2, 1
For tables like the ones above,
I would like to write SQL that returns true if B contains 2, or false if not.
Response Example
A,contains 1, true 2, false
How can I write SQL that satisfies the above?
(From comments)
How to determine if a valueappears in a GROUP BY group may be helpful.
SELECTA, IF(SUM(B=2), 'true', 'false') AS contents FROM samples GROUP BY;
540 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
518 The method of the class of the application that I am creating in Typescript does not work as I expected.
607 /usr/bin/google-chrome:symbol lookup error:/usr/bin/google-chrome: undefined symbol:gbm_bo_get_modifier
541 Understanding How to Configure Google API Key
972 In Java servlet, when SHA-256 sends WW-Authenticate header for digest authentication, the client does not return the result.
© 2024 OneMinuteCode. All rights reserved.