当前位置:网站首页>Get max value of a bit column - get max value of a bit column
Get max value of a bit column - get max value of a bit column
2022-06-24 18:18:00 【javail】
problem :
I have a SELECT request with 'inner join' in the joined table is a column with bit type. I have a connection table with “ Internal connection ” Of SELECT The request is a column of bit type .
I want to select 1 if in the joined table is at most one value with 1. If it is not the case the value will be 0. If there is at most one value in the connection table , I want to choose 1. If this is not the case , Then the value will be 0.
So If I have: So if I have :
PERSID | NAME1 | Toto2 | Titi3 | TataAnd the second table And a second table
PERSID | BOOL1 | 01 | 02 | 02 | 1I would like to have for result I want results
Toto -> 0Titi -> 1Tata -> 0I try this: I'll try this :
SELECT sur.* ,MAX(bo.BOOL) FROM SURNAME sur INNER JOIN BOOL bo ON bo.IDPERS = sur.IDPERSBut MAX is not available on BIT column.. So how can I do that? however MAX stay BIT Not available on column .. So what should I do ?
Thanks, thank you ,
Solution :
Reference resources : https://stackoom.com/en/question/jKbY边栏推荐
- RestCloud ETL抽取动态库表数据实践
- 腾讯云TCS:面向应用的一站式PaaS 平台
- Business leaders compete for CIO roles
- 2. Leveldb design principle -- LSM
- Keep two decimal places
- [North Asia data recovery]_ mdb_ catalog. Mongodb database data recovery case in case of WT file corruption
- [untitled]
- Complete Guide to web application penetration testing
- Php7.4.28 installing the pcntl extension
- Dunhuang Research Institute and Tencent have launched a new strategic cooperation to take you around the digital new silk road with AI
猜你喜欢

Five skills of selecting embedded programming language
What if the database table structure changes? Smartbi products support one click synchronization

13 ways to reduce the cost of cloud computing

Error reported after NPM I
Paper sharing | self supervised learning paper jointly released by Yann Lecun and read by engineers
SQL basic tutorial (learning notes)

Four security issues of low code and no code development

Ten excellent business process automation tools for small businesses

Crmeb multi merchant PC packaging tutorial

The 'ng' entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If you include a path, make sure the path is correct, and then
随机推荐
Easygbs video platform TCP active mode streaming exception repair
Uniapp wechat applet calls mobile map to navigate to the target point
Application service access configuration parameters
Wechat applet to realize stacked rotation
Eight recommended microservice testing tools
浅谈云流送多人交互技术原理
[untitled]
About whether arm's large and small end mode is related to CPU or compiler
Number of occurrences of numbers in the array (medium difficulty)
Fragment usage
Use BPF to count network traffic
Use py-mysql2pgsql to synchronize MySQL data to Greenplum
Redis series (3) - sentry highly available
On the principle of cloud streaming multi person interaction technology
TCE was shortlisted as a typical solution for ICT innovation of the Ministry of industry and information technology in 2020
Keep two decimal places
Install MySQL using Yum for Linux
Leetcode question 136 [single number]
Leetcode skimming questions - the 72nd biweekly match and 281 weekly match
【你真的会用ES吗】ES基础介绍(一)
