I am trying to do this in the SQL page of phpMyAdmin, but I get a syntax
error. Can someone please help me out ?
Thanks for your time and efforts!
JC
INSERT INTO `Test` ( `pkey` , `col2` , `col3` )
VALUES (
SELECT max( `pkey` )
FROM Test, `rrrrrrrrr` , `wwwwwwwww` )
pkey is the primary key, not null, varchar 11
col2 and col3 are both varchar 25, and can be null.
Also, the "Select Max('pkey') from Test" query works fine as a stand-alone
query.
This is the exact error I get from phpMyAdmin.
Error
SQL-query :
INSERT INTO `Test` ( `pkey` , `col2` , `col3` )
VALUES (
SELECT max( `pkey` )
FROM Test, `rrrrrrrrr` , `wwwwwwwww`
)
MySQL said:
#1064 - You have an error in your SQL syntax near 'SELECT max(
`pkey` )
FROM Test, `rrrrrrrrr` , `wwwwwwwww` )' at line 3 3 2547
JC-Atl wrote: I am trying to do this in the SQL page of phpMyAdmin, but I get a syntax error. Can someone please help me out ? Thanks for your time and efforts! JC
INSERT INTO `Test` ( `pkey` , `col2` , `col3` ) VALUES ( SELECT max( `pkey` ) FROM Test, `rrrrrrrrr` , `wwwwwwwww` )
Subqueries are supported starting from version 4.1, perhaps you have an
older verions of MySQL: http://www.mysql.com/doc/en/Subqueries.html
JC-Atl wrote: I am trying to do this in the SQL page of phpMyAdmin, but I get a syntax error. Can someone please help me out ? Thanks for your time and efforts! JC
INSERT INTO `Test` ( `pkey` , `col2` , `col3` ) VALUES ( SELECT max( `pkey` ) FROM Test, `rrrrrrrrr` , `wwwwwwwww` )
Subqueries are supported starting from version 4.1, perhaps you have an
older verions of MySQL: http://www.mysql.com/doc/en/Subqueries.html
JC-Atl wrote: I am trying to do this in the SQL page of phpMyAdmin, but I get a syntax error. Can someone please help me out ? Thanks for your time and efforts! JC
INSERT INTO `Test` ( `pkey` , `col2` , `col3` ) VALUES ( SELECT max( `pkey` ) FROM Test, `rrrrrrrrr` , `wwwwwwwww` )
Subqueries are supported starting from version 4.1, perhaps you have an
older verions of MySQL: http://www.mysql.com/doc/en/Subqueries.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: red |
last post by:
I don't see why mysql is telling me the following is a syntax error:
create table articles
{ file char(30) not null
};
What is wrong with that ?
|
by: |
last post by:
I use MySQL from my php page and from phpMyAdmin.
In Windows Server, following query works fine. In Linux Server instead it
returns error.
The SQL Query is:
SELECT DISTINCT a.id, a.container, b.container FROM folder AS a JOIN folder
AS b ON a.container=b.id
The PHP error is:
|
by: fritz |
last post by:
Trying to get at mysql. I installed mysql on two separate machines and
am unable to access either one. On the first I couldn't put it on C:
because that was a limited DOS drive. So here is the my.ini file for this:
#This File was made using the WinMySQLAdmin 1.4 Tool
#7/5/2004 10:56:37 AM
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
|
by: KevLow |
last post by:
Hi,
Hope some kind soul can help me out here..
I'm trying to programmatically modify the column headings of a crosstab
query such that it can be dynamic based on user specified period (Month
Year to Month Year)
So far i have tried to use the following code:
//
|
by: Don Wash |
last post by:
Hi All!
I've been searching everywhere for a simple sample of producing a bar graph
using CrystalReport by specifying SQL Query, and I've found none of it! I
find so many complex samples with so many features buried in the sample but
all I want to know is a very simple thing, how to create bar charts with
CrystalReport in VS.NET using SQL Query.
Could anyone provide me a sample showing how to produce a simple bar chart
using SQL Query...
| |
by: one man army |
last post by:
Hi All-
I am new to PHP. I found FAQTS and the php manual. I am trying this
sequence, but getting 'no zip string found:'... PHP Version 4.4.0
$doc = new DomDocument;
$res = $doc->loadHTMLFile("./aBasicSearchResult.html");
if ( $res == true )
{
$zip = $doc->getElementById('zipRaw_id')->value;
if ( 0 != $zip ) {
|
by: ZafT |
last post by:
Hi all - thanks in advance for any help.
I am trying to write a simple update script. In fact, I am re-using code
that I've used before (successfully) but I can't figure out why it is not
working. The script completes without any errors, but does not actually
update the database.
Also, the "check for same name" query works fine, and will return the proper
error if a duplicate is found.
|
by: kkddrpg |
last post by:
the database looks like this
the database is called
username_tpp (not really just using username as a sub)
the table is called
home
it has
field 1 : varchar(50) | latin1_swedish_ci | no attributes | null = no |
default = (nothing) | extra = (nothing) | action = primary key |
comments = h
|
by: tedpottel |
last post by:
Hi,
I have the following code
<?php
//DatabaseConnect();
if (!($dblink = mysql_connect("drt-
sport.com","drtspo_tedted","oreo8157")))
die(" could not connect to mysal");
if (!$dbconn = mysql_select_db("drtspo_zc1",$dblink))
die(" Could not connect to databse ");
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |