943,756 Members | Top Members by Rank

Ad:
Jun 5th, 2009
0

Questions about SQL

Expand Post »
I want to get the row number of a specific row in the table.

Also is this legal?


INSERT INTO (SELECT * FROM myTable WHERE mynumber=2) VALUES ........
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Xessa is offline Offline
58 posts
since Jan 2008
Jun 5th, 2009
0

Re: Questions about SQL

Click to Expand / Collapse  Quote originally posted by Xessa ...
I want to get the row number of a specific row in the table.

Also is this legal?


INSERT INTO (SELECT * FROM myTable WHERE mynumber=2) VALUES ........
Getting the row number depends on the DB you're using; Oracle supports this (via ROWNUM ) but MySQL for example does not.

Your statement is invalid; if you want to update a row you should be doing:

sql Syntax (Toggle Plain Text)
  1. UPDATE myTable SET foo = 'bar' WHERE mynumber = 2;
Last edited by pty; Jun 5th, 2009 at 10:17 am.
pty
Reputation Points: 64
Solved Threads: 39
Posting Pro
pty is offline Offline
530 posts
since Oct 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Database Design Forum Timeline: To First Normal form or Not?
Next Thread in Database Design Forum Timeline: Database design for child care





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC