select tf.Id,tf.Name,tf.LName,tf.Rank,tf.Category
where tf.Id not in (select fighter_id from tbl_player_fighter where league_id=91)
and tf.Status ='1'
This is throwing a syntax error. Any advice on how to fix this. Thanks.
You are missing a FROM clause, so it doesn't know the main table to use.
Related
the first post on here so apologies if I haven't formatted things properly or if I'm not entirely clear, but I was wondering if someone may be able to assist with an error I'm facing currently.
To give some context, I'm trying to run an SQL query through my phpMyAdmin, in order to fix a customer error we were receiving on-site, after changing our Stripe accounts
WooCommerce support had provided me with the following link:
https://woocommerce.com/document/stripe-fixing-customer-errors/#section-3
However, when I try this in my phpMyAdmin, I get the following error:
Unexpected keyword. (near INNER JOIN) Unrecognized statement type.
(near INNER JOIN)
SQL Error
The query that they had asked me to run is seen here:
DELETE FROM `wp_usermeta`
WHERE meta_key IN ( '_stripe_customer_id', '_stripe_source_id', '_stripe_card_id' );
DELETE tokenmeta FROM `wp_woocommerce_payment_tokenmeta` tokenmeta
INNER JOIN `wp_woocommerce_payment_tokens` ON `wp_woocommerce_payment_tokens`.`token_id` = tokenmeta.`payment_token_id`
WHERE `wp_woocommerce_payment_tokens`.`gateway_id` = 'stripe';
DELETE FROM `wp_woocommerce_payment_tokens` WHERE gateway_id='stripe';
I had spoken to support, who had said that the query is absolutely fine and they could run it on their end, and my developer friends are also a little unsure about this.
Is someone able to shed some light on this and see if I'm doing something wrong? There is a good chance that there is a simple change that's needed that's gone over my head, but I'm just not too sure what it is!
Hello Team I new to ACCESS, getting a syntax error for the below query
I think your problem is all the double quotation marks. Try this:
SELECT HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO, HRMNZ_TRF_SCH.SCH_B_CMDTY_CD, CAT_ID_HTSUSA_XREF.CAT_ID_NO_20, CAT_ID_HTSUSA_XREF.LAST_UPDT_TS, CAT_ID_HTSUSA_XREF.LAST_UPDT_LOGON_ID
FROM Z1TJ111$.HRMNZ_TRF_SCH HRMNZ_TRF_SCH INNER JOIN Z1TJ111$.CAT_ID_HTSUSA_XREF.CAT_ID_HTSUSA_XREF ON HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO=CAT_ID_HTSUSA_XREF.HRMNZ_TRF_SCH_NO
WHERE NOT (HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='7211.23.3000' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8427.20.8000' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8427.90.0000' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8525.50.7010' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8525.60.1050' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8526.10.0040' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8526.91.0020' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8526.91.0040' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='8527.99.1500' OR HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO='9014.10.7080') AND HRMNZ_TRF_SCH.HRMNZ_TRF_SCH_NO<>HRMNZ_TRF_SCH.SCH_B_CMDTY_CD
Use the query editor to get tips about what is wrong. If you don't know how here is a tutorial: https://www.tutorialspoint.com/ms_access/ms_access_sql_view.htm
i'm getting a really confused problem... i'm triying to do a query:
SELECT ordenes_servicio.idorden, estatus_orden.descripcion AS estatus, tipo_orden.descripcion AS tipo_orden, usuario.nombre, ordenes_servicio.nombres_cliente, ordenes_servicio.fecha_asig
FROM ordenes_servicio
INNER JOIN estatus_orden ON ordenes_servicio.idestatus_orden = estatus_orden.idestatus_orden
INNER JOIN tipo_orden ON ordenes_servicio.idtipo_orden = tipo_orden.idtipo_orden
INNER JOIN usuario ON ordenes_servicio.id = usuario.id
ORDER BY ordenes_servicio.idorden DESC
The problem is that when i try to run it, it say
ER_BAD_FIELD_ERROR: Unknown column 'ordenes_servicio.idusuario' in
'on clause'
But if you look at the query, there is no 'ordenes_servicio.idusuario', and yes there was, but i update my tables, both of them, and it is like the query is still triying to get that column.
When i execute the query in my MySQL Workbench it work, but dont when i try to run it in my application... Someone can help me? :/
Note: my "app" is actually a REST API in typescript, and i'm using express library
I got the answer... if can help a beginner like me someday. Im actually executing three querys, and there was one of then that still had "ordenes_servicio.idusuario"... that's all.. So check your querys!
Beginner error...
Can anyone help my find this syntax error?
SELECT `song`, COUNT(*)
FROM `2015_awards`
WHERE `song` IS NOT `NoVote`
GROUP BY `song`;
I'm trying to exclude NoVote songs, and it won't work. Everything else is fine. When I Google problems like this, it looks as though it should work.
IS NOT is wrong. What you probably need to use is <>.
You cant not use pass NoVote as a value to IS or IS NOT
Try this:
SELECT song, COUNT(*) FROM 2015_awards WHERE song != 'NoVote' GROUP BY song;
The IS Keyword is only for NULL comparisons.
As Pigasus says, you probably should be using <>.
Hope this will solve your problem
I am executing the follow mysql query and getting error saying wrong syntax.
SELECT COUNT(*) FROM PS.INFO WHERE IPADDRESS='1.1.1.1' AND ID='YYY' AND (TYPE='PAID' 0R TYPE='FREE') AND EXPIRYTIME IS NULL;
Please help me out with the correct syntax?
Your wrote 0R (zero-R) instead of OR (O-R).
TYPE='PAID' 0R TYPE='FREE'
OR
appears to have a zero instead of an O
The error always tells you where to look. In this case it says "near '0R..."
And sure enough, that's a zero, not an O. It should be the word OR.