Étant donné la bandtable, avec une jsoncolonne contenant un tableau: id | people ---+------------- 1 | ['John', 'Thomas'] 2 | ['John', 'James'] 3 | ['James', 'George'] Comment lister le nombre de bandes dont chaque nom fait partie? Sortie désirée: name | count -------+------------ John | 2 James | 2 Thomas …
J'ai cette requête ( SQLFiddle ): SELECT c.name, a.user_id, a.status_id, a.title, a.rtime, u.user_name, s.status_name FROM company c LEFT JOIN action a ON a.company_id=c.id LEFT JOIN user u ON u.id=a.user_id LEFT JOIN status s ON s.id=a.status_id WHERE u.user_name='Morgan' -- WHERE c.name='Fiddle' GROUP BY c.id HAVING a.rtime IS NULL OR a.rtime = …
Je suis un programmeur, traitant d'une grande table dont le schéma suivant: UpdateTime, PK, datetime, notnull Name, PK, char(14), notnull TheData, float Il existe un index clusterisé sur Name, UpdateTime Je me demandais ce qui devrait être plus rapide: SELECT MAX(UpdateTime) FROM [MyTable] ou SELECT MAX([UpdateTime]) AS value from ( …
We use cookies and other tracking technologies to improve your browsing experience on our website,
to show you personalized content and targeted ads, to analyze our website traffic,
and to understand where our visitors are coming from.
By continuing, you consent to our use of cookies and other tracking technologies and
affirm you're at least 16 years old or have consent from a parent or guardian.