![]() |
Datenbank: MySQL • Version: 5.0 • Zugriff über: phpMyAdmin
Unbekanner Fehler in SubQuery
Hallo!
Habe ein kleines Problem mit einem MySQL-Befehl:
SQL-Code:
Der Fehler liegt am Anfang des SubQueries. Aber ich sehe keinen Fehler?!
ALTER TABLE `bc_customers`
DROP `id`, CHANGE `kundennummer` `customer_id` SMALLINT NOT NULL AUTO_INCREMENT, AUTO_INCREMENT = ( SELECT MAX(`customer_id`) FROM `bc_customers` ) ADD PRIMARY KEY (`customer_id`); Grüße Faux |
Re: Unbekanner Fehler in SubQuery
Okay hat sich erübrigt.
Aus der MySQL Doku: Zitat:
Wie könnte ich das sonst noch in reinem SQL lösen? Grüße Faux |
Re: Unbekanner Fehler in SubQuery
Hallo,
ich kann es gerade nicht ausprobieren, aber warum lässt du die table option nicht einfach weg? MySQL 5.0.3 Reference - CREATE TABLE An integer column can have the additional attribute AUTO_INCREMENT. When you insert a value of NULL (recommended) or 0 into an indexed AUTO_INCREMENT column, the column is set to the next sequence value. Typically this is value+1, where value is the largest value for the column currently in the table. AUTO_INCREMENT sequences begin with 1. Grüße vom marabu |
Re: Unbekanner Fehler in SubQuery
Stimmt. :oops:
Danke sehr. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 22:18 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz