|
|
|
Author |
Message |
Rickbo
|
Posted: Mon Sep 08 04:49:49 CDT 2003 |
Top |
SQL Server Developer >> Row id
Is there any implicit row id for each row in the table. If yes then
how to select it .
Thank You.
SQL Server105
|
|
|
|
|
Wayne
|
Posted: Mon Sep 08 04:49:49 CDT 2003 |
Top |
SQL Server Developer >> Row id
You would most likely use the Primary key column to identify, but as the
other poster said... no rowid for SQL.
You might take a look at the timestamp data type (FYI)
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), C****te, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
> Is there any implicit row id for each row in the table. If yes then
> how to select it .
> Thank You.
|
|
|
|
|
Alejandro
|
Posted: Mon Sep 08 08:11:27 CDT 2003 |
Top |
|
|
|
Joe
|
Posted: Mon Sep 08 10:03:40 CDT 2003 |
Top |
SQL Server Developer >> Row id
This is a multi-part message in MIME format
------=_NextPart_000_23604262
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
No, there is not. And you should not be writing SQL as if you were
still using a sequential file system. Please read a book on thre basics
of the relational model before you start coding.
--CELKO--
===========================
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
------=_NextPart_000_23604262
Content-Type: text/html; name="_alt.0"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="_alt.0"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4=2E0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html;=
charset=3Dwindows-1252">
<META content=3D"MSHTML 6=2E00=2E2800=2E1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV><FONT face=3DTahoma size=3D2>Try:</FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>select</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
m=2E*</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>from</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> MyTable=
as
m</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>join</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>(</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
select</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
ItemID</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
, max
(Bid)</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
from</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
MyTable</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> group=
by</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
ItemID</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>) as x on x=2EItemID =3D=
m=2EItemID</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
and
x=2EBid =3D m=2EBid</FONT></DIV>
<DIV><BR>-- <BR>Tom</DIV>
<DIV> </DIV>
<DIV>------------------------------------------------------------=
---<BR>Thomas
A=2E Moreau, BSc, PhD, MCSE, MCDBA<BR>SQL Server MVP<BR>Columnist,=
SQL Server
Professional<BR>Toronto, ON Canada<BR><A
href=3D"http://www=2Epinnaclepublishing=2Ecom/sql">www=2Epinnaclepublishi=
ng=2Ecom/sql</A></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>"Josh Gerszewski" <<A
<A
everyone,<BR><BR>I'm trying to design an auction site for my=
company's intranet
and I'm<BR>having a problem getting the right info out of my db=2E=
This is what my
table<BR>and example data look like:<BR><BR>KeyID | ItemID |=
ItemName |
ItemPrice | ItemBriefDesc | Bidder | Bid |<BR>1 | 2 | Small Black=
Bear | 50=2E00 |
Stuffed with brown nose | NULL | =2E0000 |<BR>2 | 3 | Joe's Life |=
1=2E00 | Somewhat
valuable | NULL | =2E0000 |<BR>4 | 3 | Joe's Life | 1=2E00 | Somewhat=
valuable |
1167 | 1=2E0200 |<BR>5 | 3 | Joe's Life | 1=2E00 | Somewhat valuable=
| 1381 | 2=2E0200
|<BR>3 | 4 | Small Brown Bear | 100=2E00 | Stuffed with brown nose=
| NULL | =2E0000
|<BR>6 | 4 | Small Brown Bear | 100=2E00 | Stuffed with brown nose=
| 2023
|<BR>4000=2E0000 |<BR><BR>I'd like to get it down to this (a list=
of the item with
the top bidder):<BR>KeyID | ItemID | ItemName | ItemPrice |=
ItemBriefDesc |
Bidder | Bid |<BR>1 | 2 | Small Black Bear | 50=2E00 | Stuffed with=
brown nose |
NULL | =2E0000 |<BR>5 | 3 | Joe's Life | 1=2E00 | Somewhat valuable |=
1381 | 2=2E0200
|<BR>6 | 4 | Small Brown Bear | 100=2E00 | Stuffed with brown nose=
| 2023
|<BR>4000=2E0000 |<BR><BR>I've tried to use a bunch of different=
queries including
grouping and max<BR>functions, but nothing seems to be working=2E=
The following
query works if I<BR>take out the bidder but I need that in my
query:<BR><BR>Select f1=2EItemID, f1=2EItemName, f1=2EItemPrice,=
f1=2EItemBriefDesc,
bidder,<BR>Max(f1=2EBid) AS Bid<BR> From FOP001=
f1<BR>
Where f1=2EForumID =3D 1<BR> Group By ItemID, ItemName,=
ItemPrice,
ItemBriefDesc , bidder<BR><BR>If anyone can help me out with this=
I'd really
appreciate it=2E<BR><BR>Thanks for your time=2E=2E=2E<BR>Josh
Gerszewski<BR><BR></BODY></HTML>
------=_NextPart_000_23604262--
|
|
|
|
|
|
|