Why doesn't this GROUP BY query work?


thin tube

I am using the following query to query an Access table:

SELECT (VIN&' '&Make&' '&Model&' '&CarYear&' '&ExColor&' '&InColor&' ')as CarDescript
        FROM TestTable
        WHERE (WorkOrderNumber='$workorder')
        GROUP BY AssignedEmp;

But similar query types work fine in this SQL Fiddle

Even if I replaced the trombone with VIN (VIN &'' &....) it still didn't work.

EDIT: The schema of the table is

WorkOrderNumber-Priority-JobStage-WorkItem-AssignedEmp-DueDate-VIN-Made-...-InColor

Hogan

Generally used +instead of &SQL. (However, access will allow this).

In a grouping, you need to choose which grouping to use in the grouping (if you use mysql like the example, it just chooses a random grouping, see this fiddle ), to solve this problem in a general example:

SELECT (max(VIN) + ' ' + max(Make) + ' ' + max(Model) + ' ' + max(CarYear) + ' ' + max(ExColor) + ' ' + max(InColor) + ' ')
       as CarDescript
FROM TestTable
WHERE WorkOrderNumber='$workorder'
GROUP BY AssignedEmp;

Related


Why doesn't "COALESCE" work with "GROUP BY"?

John Alexander I have a table tablewith the following data: +----------+------+----------+ | location | sold | scrapped | +----------+------+----------+ | Paris | 5 | NULL | | Paris | NULL | 6 | +----------+------+----------+ I want this:

Why FireStore where query doesn't work?

TSR FireStore whereis not working, or I am doing something wrong. I am trying to email the user:[email protected] Here is the code: const admin = require('firebase-admin'); var serviceAccount = require('../secret/nicecode-e3e53-2ddaa9d588ea.json'); admin.ini

Group by name in query formula doesn't work

Warren Melloni So I use a query function to count the number of instances where a particular name appears in column A of another sheet and display the result in column B of this sheet and the corresponding name in column A. Here is the function: =ArrayFormula(

why this query doesn't work

Nicoletta Sotiri I'm new to SQL so I don't understand why this query doesn't work. Thank you in advance CREATE VIEW temp AS SELECT return_date_time, renting_date_time FROM renting; CREATE TRIGGER charge_calc AFTER UPDATE ON renting.return_date_time FOR EACH R

Why graphql query doesn't work in react?

Andre Mello In my React project, I use query to search github user data. The query is as follows: const GET_USER = (user) => ` { user(login: "${user}") { name login avatarUrl company gists{ totalCount } following{ totalCo

Why doesn't Solr query work on spaces?

Aswin Raghavan I'm a beginner in Solr and have the following set of indexes in my Soleserver: { "id": "book5", "title": [ "Five point someone" ], "author": "Chetan Bagat", "genere": "fantasy", "de

Why doesn't this query work for the specified date?

User 7475343 I have connected my database using php. When I press the delete button, a php file is connected to another php file with the following code: <?php include("dbconfig.php"); $memberID = $_GET['memberID']; $ISBN = $_GET['ISBN']; $copyNr = $_GET['c

Why doesn't "COALESCE" work with "GROUP BY"?

John Alexander I have a table tablewith the following data: +----------+------+----------+ | location | sold | scrapped | +----------+------+----------+ | Paris | 5 | NULL | | Paris | NULL | 6 | +----------+------+----------+ I want this:

Why doesn't PDO query work on the server?

Dojo development I just uploaded my local project to the server, but PDO query doesn't work in LIVE server. It works fine locally. I thought maybe PDO wasn't installed on the server, so I ran the script below The PHP version in the server is PHP Version 5.3.3,

Why doesn't this query work?

username Why does the following query not work in SQL Server 2008? SELECT CONVERT(INT, TEMP.observ_value) AS value FROM (SELECT observ_value FROM LAB_RESULTS WHERE observ_value NOT LIKE '%[^0-9]%') TEMP WHERE observ_value >= 190 Her

Why doesn't this query work?

username Why does the following query not work in SQL Server 2008? SELECT CONVERT(INT, TEMP.observ_value) AS value FROM (SELECT observ_value FROM LAB_RESULTS WHERE observ_value NOT LIKE '%[^0-9]%') TEMP WHERE observ_value >= 190 Her

Why query update doesn't work at all

Andy So I've been trying to change my code to any other suitable way but nothing happens...I want to change status_data_userfrom active to inactive but it doesn't work...in my The other delete code works without any problem. I keep changing it to $hapus = mysq

Why graphql query doesn't work in react?

Andre Mello In my React project, I use query to search github user data. The query is as follows: const GET_USER = (user) => ` { user(login: "${user}") { name login avatarUrl company gists{ totalCount } following{ totalCo

Why FireStore where query doesn't work?

TSR FireStore whereis not working, or I am doing something wrong. I am trying to email the user:[email protected] Here is the code: const admin = require('firebase-admin'); var serviceAccount = require('../secret/nicecode-e3e53-2ddaa9d588ea.json'); admin.ini

Why doesn't '=' work in this SQL query?

Jack Lu I have a query against a sakila database in MySQL 8 (you can easily setup one from https://hub.docker.com/r/1maa/sakila ). select * from store _0 where ( select address_id from ( select * from address _3 where ( address_id = (

Why doesn't this query work for the specified date?

User 7475343 I have connected my database using php. When I press the delete button, a php file is connected to another php file with the following code: <?php include("dbconfig.php"); $memberID = $_GET['memberID']; $ISBN = $_GET['ISBN']; $copyNr = $_GET['c

Group by database query in laravel doesn't work

Zeeshan Nisar I am new to Laravel. I have a database table named A with column names 1,2,3 . In column 3 I have different values like a,b,c. Now what I want is to print out the total value of a, b and c using the group by clause. Sorry, my English is no good.

Why doesn't '=' work in this SQL query?

Jack Lu I have a query against a sakila database in MySQL 8 (you can easily setup one from https://hub.docker.com/r/1maa/sakila ). select * from store _0 where ( select address_id from ( select * from address _3 where ( address_id = (

Why query update doesn't work at all

Andy So I've been trying to change my code to any other suitable way but nothing happens...I want to change status_data_userfrom active to inactive but it doesn't work...in my The other delete code works without any problem. I keep changing it to $hapus = mysq

Why doesn't this group by query work?

Joseph My query is not grouping correctly and returning wrong results, I can't figure out what the problem is. The query is as follows. FYI - the current form is unclear, the reason I need group by is because I removed all other parts of the query to find the

Group by name in query formula doesn't work

Warren Melloni So I use a query function to count the number of instances where a specific name appears in column A of another sheet and display the result in column B of this sheet and the corresponding name in column A. Here is the function: =ArrayFormula(QU

Mysql doesn't work in query using GROUP BY - why?

Orange 555 Weird wording " Notdoesn't work!" I know, but the strange thing is that the returned results do exist user_iddespite the query pointing to NOT (user_id = 1). SELECT post_id, last_update FROM the_table WHERE last_update BETWEEN N

Why this (group) MySQL query doesn't work

Ilan Kleiman I have this MySQL query but can't seem to solve it. I want it to group the "symbols" in the table "portfolio". ( SELECT symbol FROM portfolio GROUP BY symbol) though, I would like it to limit its search to: ( WHERE key = '$key' AND hash = '$hash'

Group by name in query formula doesn't work

Warren Melloni So I use a query function to count the number of instances where a specific name appears in column A of another sheet and display the result in column B of this sheet and the corresponding name in column A. Here is the function: =ArrayFormula(QU

Why doesn't "COALESCE" work with "GROUP BY"?

John Alexander I have a table tablewith the following data: +----------+------+----------+ | location | sold | scrapped | +----------+------+----------+ | Paris | 5 | NULL | | Paris | NULL | 6 | +----------+------+----------+ I want this:

Group by name in query formula doesn't work

Warren Melloni So I use a query function to count the number of instances where a specific name appears in column A of another sheet and display the result in column B of this sheet and the corresponding name in column A. Here is the function: =ArrayFormula(QU

Why doesn't this group by query work?

Joseph My query is not grouping correctly and returning wrong results, I can't figure out what the problem is. The query is as follows. FYI - the current form is unclear, the reason I need group by is because I removed all other parts of the query to find the

Group by expression doesn't work in this SQL query?

shamveel_ahammed I am new to SQL. Can anyone help me find out why the "Group By" expression is not working in this sql query? i get this error ERROR at line 3: ORA-00979: not a GROUP BY expression The code I am using is CREATE OR REPLACE VIEW CUSTOMER_LINE_IT

Why this (group) MySQL query doesn't work

Ilan Kleiman I have this MySQL query but can't seem to solve it. I want it to group the "symbols" in the table "portfolio". ( SELECT symbol FROM portfolio GROUP BY symbol) though, I would like it to limit its search to: ( WHERE key = '$key' AND hash = '$hash'