-
Select All Document IDs in a DataBase
Hi all!
I am new here. I am also new to SQL. Here's what I am trying to accomplish:
Select all (unique) document IDs in a given database. I'd like to have them display. Here is one of the queries for what I've done thus far:
SELECT docid
FROM data_base
WHERE docid > '0';
Which returns only the column "docid". I was hoping for the actual numbers, not merely the column.
What am I doing wrong?
Thank you in advance!
keega
-
Is it for sql server? Do you know table schema?
-
It is for SQL Server. Not sure of the table schema...second day doing SQL I was able to extract the info I needed, however. I'd post what I did, but it's soooo basic, you all probably already know this.
-
But thank you rmiao, knowing you guys/gals are here makes me feel pretty comfortable!
-
This will give you a list of docid and count for each
SELECT docid, count(*)
FROM data_base
group by docid
-
Thank you skhanal!
Originally Posted by skhanal
This will give you a list of docid and count for each
SELECT docid, count(*)
FROM data_base
group by docid
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|