Questions about SQL

Thread Solved

Join Date: Jan 2008
Posts: 54
Reputation: Xessa is an unknown quantity at this point 
Solved Threads: 0
Xessa Xessa is offline Offline
Junior Poster in Training

Questions about SQL

 
0
  #1
Jun 5th, 2009
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 ........
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 521
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: Questions about SQL

 
0
  #2
Jun 5th, 2009
Originally Posted by Xessa View 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 ........
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:

  1. UPDATE myTable SET foo = 'bar' WHERE mynumber = 2;
Last edited by pty; Jun 5th, 2009 at 10:17 am.
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC