473,320 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

this query fails, why?

Ok guys, here we go again!

SELECT s.nnet_produkt_storrelse_navn
FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v,
nnet_storrelse_varegruppe_assoc sv, nnet_produkt p
WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id
AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id
AND sv.nnet_produkt_varegruppe_id IN (
SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe
WHERE nnet_produkt_varegruppe_code = 'FLU17'
)
AND p.nnet_produkt_storrelse_id > 1

This produces the following error:

You have an error in your SQL syntax near 'SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!

Phil
----------------------------------------------------------------------------
----
_______________________________________________
talk mailing list
ta**@lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk
Jul 17 '05 #1
6 2638
Are you using MySQL 4.1? If not, it's absolutly normal that the query
does not work since MySQL only supports subqueries since 4.1, which is
currently an alpha release.

Phil Powell wrote:
Ok guys, here we go again!

SELECT s.nnet_produkt_storrelse_navn
FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v,
nnet_storrelse_varegruppe_assoc sv, nnet_produkt p
WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id
AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id
AND sv.nnet_produkt_varegruppe_id IN (
SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe
WHERE nnet_produkt_varegruppe_code = 'FLU17'
)
AND p.nnet_produkt_storrelse_id > 1

This produces the following error:

You have an error in your SQL syntax near 'SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!

Phil
----------------------------------------------------------------------------
----
_______________________________________________
talk mailing list
ta**@lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk


Jul 17 '05 #2
In article <cSkbb.3113$sp2.2606@lakeread04>,
"Phil Powell" <so*****@erols.com> wrote:
You have an error in your SQL syntax near 'SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!


If you are using MySQL: you can't use subqueries in MySQL yet. They are
planned for version 4.1, if I remember correctly.

If you are using another RDBMS that does support subqueries, just echo
the complete query and the error will usually be obvious.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #3
Wow. I can't do subqueries, I can't use foreign key constraints, I can't
even use the now() function for default values in an INSERT statement on a
datetime column field..

I can see I won't be doing much in the way of RDM with mySQL. *sigh* Thanx

Phil

"Louis-Philippe Huberdeau" <lp*********@sympatico.ca> wrote in message
news:8d******************@news20.bellglobal.com...
Are you using MySQL 4.1? If not, it's absolutly normal that the query
does not work since MySQL only supports subqueries since 4.1, which is
currently an alpha release.

Phil Powell wrote:
Ok guys, here we go again!

SELECT s.nnet_produkt_storrelse_navn
FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v,
nnet_storrelse_varegruppe_assoc sv, nnet_produkt p
WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id
AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id
AND sv.nnet_produkt_varegruppe_id IN (
SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe
WHERE nnet_produkt_varegruppe_code = 'FLU17'
)
AND p.nnet_produkt_storrelse_id > 1

This produces the following error:

You have an error in your SQL syntax near 'SELECT nnet_produkt_varegruppe_id FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!

Phil


--------------------------------------------------------------------------

--
----
_______________________________________________
talk mailing list
ta**@lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk

Jul 17 '05 #4
In article <j6ubb.5245$sp2.4830@lakeread04>,
"Phil Powell" <so*****@erols.com> wrote:
Wow. I can't do subqueries, I can't use foreign key constraints, I can't
even use the now() function for default values in an INSERT statement on a
datetime column field..


I'll be the first to admit that MySQL has its limits, but you can use
foreign key constraints if you use the InnoDB table type, and you can
define a field as type 'TIMESTAMP' if you need to automatically enter
the current date/time on INSERT.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #5
You can't use NOW(), but there is an equivalent somewhere. Just search
the documentation. As for the foreign keys, they are availible if you
use InnoDB instead of the default MyISAM. Once again, a simple search in
the documentation will tell you that it has been availible for a while.

Phil Powell wrote:
Wow. I can't do subqueries, I can't use foreign key constraints, I can't
even use the now() function for default values in an INSERT statement on a
datetime column field..

I can see I won't be doing much in the way of RDM with mySQL. *sigh* Thanx

Phil

"Louis-Philippe Huberdeau" <lp*********@sympatico.ca> wrote in message
news:8d******************@news20.bellglobal.com...
Are you using MySQL 4.1? If not, it's absolutly normal that the query
does not work since MySQL only supports subqueries since 4.1, which is
currently an alpha release.

Phil Powell wrote:
Ok guys, here we go again!

SELECT s.nnet_produkt_storrelse_navn
FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v,
nnet_storrelse_varegruppe_assoc sv, nnet_produkt p
WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id
AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id
AND sv.nnet_produkt_varegruppe_id IN (
SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe
WHERE nnet_produkt_varegruppe_code = 'FLU17'
)
AND p.nnet_produkt_storrelse_id > 1

This produces the following error:

You have an error in your SQL syntax near 'SELECT
nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!

Phil


--------------------------------------------------------------------------


--
----
_____________________________________________ __
talk mailing list
ta**@lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk



Jul 17 '05 #6
I know about InnoDB but the version of mySQL running on the remote server
where the client who is paying me to do freelance work for is an older
version that does not allow for InnoDB to be an option for table type.

Phil

"Louis-Philippe Huberdeau" <lp*********@sympatico.ca> wrote in message
news:qk*******************@news20.bellglobal.com.. .
You can't use NOW(), but there is an equivalent somewhere. Just search
the documentation. As for the foreign keys, they are availible if you
use InnoDB instead of the default MyISAM. Once again, a simple search in
the documentation will tell you that it has been availible for a while.

Phil Powell wrote:
Wow. I can't do subqueries, I can't use foreign key constraints, I can't even use the now() function for default values in an INSERT statement on a datetime column field..

I can see I won't be doing much in the way of RDM with mySQL. *sigh* Thanx
Phil

"Louis-Philippe Huberdeau" <lp*********@sympatico.ca> wrote in message
news:8d******************@news20.bellglobal.com...
Are you using MySQL 4.1? If not, it's absolutly normal that the query
does not work since MySQL only supports subqueries since 4.1, which is
currently an alpha release.

Phil Powell wrote:

Ok guys, here we go again!

SELECT s.nnet_produkt_storrelse_navn
FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v,
nnet_storrelse_varegruppe_assoc sv, nnet_produkt p
WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id
AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id
AND sv.nnet_produkt_varegruppe_id IN (
SELECT nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe
WHERE nnet_produkt_varegruppe_code = 'FLU17'
)
AND p.nnet_produkt_storrelse_id > 1

This produces the following error:

You have an error in your SQL syntax near 'SELECT


nnet_produkt_varegruppe_id
FROM nnet_produkt_varegruppe WHERE nnet_produk' at line 1
I don't see anything wrong with this query, it's standard inner SELECT
stuff! I need help... again!

Phil

--------------------------------------------------------------------------

--
----
_____________________________________________ __
talk mailing list
ta**@lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk


Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: josh dismukes | last post by:
//Query the Database $query = "SELECT type FROM map WHERE map_file = " . $_SESSION . " AND col = " . $_SESSION . " AND row = " . $_SESSION; $db_result = @mysql_query($query); $db_cell_type =...
3
by: Philip Yale | last post by:
A colleague of mine has a query which fails to run under SQLAgent batch with the following error: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime...
0
by: Steve | last post by:
Hi, Is there something fundamentally wrong with the following query? SELECT MAX(OrderID) AS Expr1 FROM Orders WHERE (MarketActionCode = 'S') AND (OrderLegCode = 'S') AND (Status = 'F') AND...
3
by: Rich N | last post by:
I want to move several records from one table to a new table. My database is set up so that there's the "regular" database, and the ".be" database. In which do I use the Make Table Query?
2
by: Puneet Murgai | last post by:
I am trying to run an access query which works when I write it directly in the database. However, it fails when an SQL script containing it is run from C++. It doesn't recognize the Iff and Nz...
0
by: Winterminute | last post by:
I am trying to read a list of install programs using WMI with ASP.NET/C#. However, it fails with "Invalid Class". I have confirmed that if I query LOCALHOST then it works fine, but if I query a...
1
by: Alex | last post by:
Hi, I need some help with a query. I use a reference table to lookup some codes. Everything works well if the reference table contains a reference but the query fails if no reference fails...
4
by: Jimmy | last post by:
I have a form with a command button on it that is supposed to open up a report and use a query to populate it. DoCmd.OpenReport "rptMailingList", acViewPreview, "qryMailingListChristmas" ...
0
by: mainframetech | last post by:
We are having a problem with Access 2002 as opposed to Access 2000. A multi-file query was set up under 2000 and tested good. Access is connected through a link to an Oracle 9.1 database.It was...
2
BeemerBiker
by: BeemerBiker | last post by:
I put together a (what I consider) complex query using the Access wizard. It works fine in access but fails when I code it up. I can actually make it work in code by "simplifying" it, but then it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.