# Sql questions, problem with select \*

**URL:** <https://forum.kirupa.com/t/sql-questions-problem-with-select/81503>\
**Category:** Uncategorized\
**Created:** [March 2, 2005, 11:26pm UTC](https://forum.kirupa.com/t/sql-questions-problem-with-select/81503 "2005-03-02T23:26:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [March 2, 2005, 11:26pm UTC](https://forum.kirupa.com/t/sql-questions-problem-with-select/81503/1 "2005-03-02T23:26:07Z")

</div>

Hi all :hr:

I am using coldfusion to pass a URL variable in a link:

```auto

<a href="docDetail.cfm?Job_Number=<cfoutput>#url.RecordID#</cfoutput>">View documents for this record</a>

```

I know it is being passed correctly because it shows up in the address bar of the linked page called docDetail.

On the docDetail page is my sql query:

```auto

<cfquery name="q_docDetails" datasource="PLOG">
SELECT *
FROM data_admin.PlogDocs
WHERE Job_Number = '#URL.Job_Number#'
ORDER BY DocName DESC 
</cfquery>

```

The problem is that it is only displaying one record - the last one - for any given job number. I may have several different documents that all have the same job number but only the last one is being displayed. I am simply using cfoutput to display them in a table.

Any ideas? :h:

Thanks! 😛
