<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DevX.com Forums - Database</title>
		<link>http://forums.devx.com</link>
		<description>SQL Server, Oracle, DB2, Informix, FoxPro, MySQL, or
just plain SQL language issues.</description>
		<language>en</language>
		<lastBuildDate>Sun, 22 Nov 2009 02:41:59 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.devx.com/images/misc/rss.jpg</url>
			<title>DevX.com Forums - Database</title>
			<link>http://forums.devx.com</link>
		</image>
		<item>
			<title>SqlExec() doesnt work correctly</title>
			<link>http://forums.devx.com/showthread.php?t=173419&amp;goto=newpost</link>
			<pubDate>Sat, 21 Nov 2009 03:40:29 GMT</pubDate>
			<description><![CDATA[Hi all , i m using visual foxpro and Sql 2000 . 
When i try to excute a SqlExex( spContent ) it return 1 but nothing changed in the database . But if i use the sql query analyzer , paste the spContent 's content and run directy from there , every thing is ok ! I cant find the problem , may someone help !
Ps : the variable spContent' s length  is about 5000 and was created with a Text ... Exdtext Statement .]]></description>
			<content:encoded><![CDATA[<div>Hi all , i m using visual foxpro and Sql 2000 . <br />
When i try to excute a SqlExex( spContent ) it return 1 but nothing changed in the database . But if i use the sql query analyzer , paste the spContent 's content and run directy from there , every thing is ok ! I cant find the problem , may someone help !<br />
Ps : the variable spContent' s length  is about 5000 and was created with a Text ... Exdtext Statement .</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>hoangnnm</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173419</guid>
		</item>
		<item>
			<title>OO representation of relational database</title>
			<link>http://forums.devx.com/showthread.php?t=173406&amp;goto=newpost</link>
			<pubDate>Wed, 18 Nov 2009 16:34:15 GMT</pubDate>
			<description><![CDATA[I'm trying to convert 3 relational db tables (ones just like in access) into OO conceptual representations in which I need to note connectivity and (mandatory or optional) participation.

I have a "computer" table, a "made in" table, and a "description" table.

The computer table includes the made in & description PK's as FK's - How do I reference them in a simple OO diagram?]]></description>
			<content:encoded><![CDATA[<div>I'm trying to convert 3 relational db tables (ones just like in access) into OO conceptual representations in which I need to note connectivity and (mandatory or optional) participation.<br />
<br />
I have a &quot;computer&quot; table, a &quot;made in&quot; table, and a &quot;description&quot; table.<br />
<br />
The computer table includes the made in &amp; description PK's as FK's - How do I reference them in a simple OO diagram?</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>secretagentman</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173406</guid>
		</item>
		<item>
			<title>Custom Auto Number (Access 2007)</title>
			<link>http://forums.devx.com/showthread.php?t=173390&amp;goto=newpost</link>
			<pubDate>Tue, 17 Nov 2009 04:05:47 GMT</pubDate>
			<description><![CDATA[I have a database that requires an auto number sequence as such, 

Box 1 A1
Box 1 A2
.
.
.up to>
.
.
Box 1 A10
Box 1 B1
.
.
.up to>
.
.
Box 1 J10

After  Box 1 J10> 

Box 2 A1 
Box 2 A2

etc.

Any help with how to create this sequence automatically appear would be much appreciated.

Thanks in advance.]]></description>
			<content:encoded><![CDATA[<div>I have a database that requires an auto number sequence as such, <br />
<br />
Box 1 A1<br />
Box 1 A2<br />
.<br />
.<br />
.up to&gt;<br />
.<br />
.<br />
Box 1 A10<br />
Box 1 B1<br />
.<br />
.<br />
.up to&gt;<br />
.<br />
.<br />
Box 1 J10<br />
<br />
After  Box 1 J10&gt; <br />
<br />
Box 2 A1 <br />
Box 2 A2<br />
<br />
etc.<br />
<br />
Any help with how to create this sequence automatically appear would be much appreciated.<br />
<br />
Thanks in advance.</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>dualution</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173390</guid>
		</item>
		<item>
			<title>Passing parameters from short cuts/Icons and VFP</title>
			<link>http://forums.devx.com/showthread.php?t=173382&amp;goto=newpost</link>
			<pubDate>Sat, 14 Nov 2009 20:38:51 GMT</pubDate>
			<description>If I pass a 0 to as a parameter into a VFP program it interprets it as data type integer - which is what I would expect.  But when I set up an icon to call an VFP exe and use 0 as a parameter it is changed to data type character.  Is there a way to force it to integer?  I put code in the program to change it back to an integer but it annoys me that the OS seems to pass my integer parameter as data type character.

Thanks</description>
			<content:encoded><![CDATA[<div>If I pass a 0 to as a parameter into a VFP program it interprets it as data type integer - which is what I would expect.  But when I set up an icon to call an VFP exe and use 0 as a parameter it is changed to data type character.  Is there a way to force it to integer?  I put code in the program to change it back to an integer but it annoys me that the OS seems to pass my integer parameter as data type character.<br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>equsnarnd</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173382</guid>
		</item>
		<item>
			<title>Help with optimizing stored procedure</title>
			<link>http://forums.devx.com/showthread.php?t=173352&amp;goto=newpost</link>
			<pubDate>Wed, 11 Nov 2009 00:47:23 GMT</pubDate>
			<description><![CDATA[Hey!
I Need help with optimizing my sp.
The sp works fine, but it takes away long time to load. Like 30 sec, that is toooo much.
So I would apreciate any help.

Here's the sp:

ALTER PROCEDURE [dbo].[sp_GetCompaniesByKeywords] 
@KeyWhat varchar(150) = NULL, -- what to search for
@KeyWhere varchar(150) = NULL, -- where to search
@PageSize int = NULL, -- page size
@PageNumber int = NULL -- current page 



AS
BEGIN 
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE @RowStart int
DECLARE @RowEND int


IF (@PageNumber > 0)
BEGIN
IF (@PageNumber <=1)
SET @RowEND = @RowStart + @PageSize +1

SET @PageNumber = @PageNumber -1
SET @RowStart = @PageSize * @PageNumber+1
SET @RowEND = @RowStart + @PageSize - 1;

DECLARE @sql nvarchar(4000)
SELECT @sql = 
'Select DISTINCT ROW_NUMBER() OVER (ORDER BY C.[Name]) AS RowNumber, COUNT(*) OVER() AS Count, 
c.ID, C.[Name] AS CompanyName, C.Orgnumber AS orgnr, 
a.Address, a.zipcode, a.county, 
p.Phone,
act.[Name] AS Activity
FROM Companies as C
JOIN Addresses AS a ON a.Company_ID = C.ID
JOIN PhoneNumbers AS p ON p.Company_ID = C.ID
JOIN Activities AS act ON act.ID = C.Activity_ID
WHERE 1=1'


IF (@KeyWhat IS NOT NULL AND @KeyWhat <> '')
SELECT @sql = @sql + ' AND (C.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') +
' OR (C.Orgnumber LIKE ' + quotename(@KeyWhat + '%', '''') +
' OR p.Phone = ' + quotename(@KeyWhat, '''') + 
' OR act.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') + '))'

IF (@KeyWhere IS NOT NULL AND @KeyWhere <> '')
SELECT @sql = @sql + ' AND (a.address LIKE ' + quotename('%' + @KeyWhere + '%','''') +
' OR (a.zipcode LIKE ' + quotename('%' + @KeyWhere + '%','''') +
' OR a.county LIKE ' + quotename('%' + @KeyWhere + '%','''') + '))'


--PRINT @sql


CREATE TABLE #Result
(
RowNumber int,
[Count] int,
id int,
companyName varchar(150),
orgnumber varchar(20),
address varchar(150),
zipcode varchar(5),
county varchar(20),
phone varchar(20),
activity varchar(100)

)
INSERT INTO #Result(rownumber, [count], id, companyname, orgnumber, address, zipcode, county, phone, activity)
EXEC sp_executeSQL @sql


SELECT * From #Result WHERE RowNumber Between @RowStart and @RowEND
DROP Table #Result
END
END]]></description>
			<content:encoded><![CDATA[<div>Hey!<br />
I Need help with optimizing my sp.<br />
The sp works fine, but it takes away long time to load. Like 30 sec, that is toooo much.<br />
So I would apreciate any help.<br />
<br />
Here's the sp:<br />
<br />
ALTER PROCEDURE [dbo].[sp_GetCompaniesByKeywords] <br />
@KeyWhat varchar(150) = NULL, -- what to search for<br />
@KeyWhere varchar(150) = NULL, -- where to search<br />
@PageSize int = NULL, -- page size<br />
@PageNumber int = NULL -- current page <br />
<br />
<br />
<br />
AS<br />
BEGIN <br />
-- SET NOCOUNT ON added to prevent extra result sets from<br />
-- interfering with SELECT statements.<br />
SET NOCOUNT ON;<br />
<br />
DECLARE @RowStart int<br />
DECLARE @RowEND int<br />
<br />
<br />
IF (@PageNumber &gt; 0)<br />
BEGIN<br />
IF (@PageNumber &lt;=1)<br />
SET @RowEND = @RowStart + @PageSize +1<br />
<br />
SET @PageNumber = @PageNumber -1<br />
SET @RowStart = @PageSize * @PageNumber+1<br />
SET @RowEND = @RowStart + @PageSize - 1;<br />
<br />
DECLARE @sql nvarchar(4000)<br />
SELECT @sql = <br />
'Select DISTINCT ROW_NUMBER() OVER (ORDER BY C.[Name]) AS RowNumber, COUNT(*) OVER() AS Count, <br />
c.ID, C.[Name] AS CompanyName, C.Orgnumber AS orgnr, <br />
a.Address, a.zipcode, a.county, <br />
p.Phone,<br />
act.[Name] AS Activity<br />
FROM Companies as C<br />
JOIN Addresses AS a ON a.Company_ID = C.ID<br />
JOIN PhoneNumbers AS p ON p.Company_ID = C.ID<br />
JOIN Activities AS act ON act.ID = C.Activity_ID<br />
WHERE 1=1'<br />
<br />
<br />
IF (@KeyWhat IS NOT NULL AND @KeyWhat &lt;&gt; '')<br />
SELECT @sql = @sql + ' AND (C.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') +<br />
' OR (C.Orgnumber LIKE ' + quotename(@KeyWhat + '%', '''') +<br />
' OR p.Phone = ' + quotename(@KeyWhat, '''') + <br />
' OR act.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') + '))'<br />
<br />
IF (@KeyWhere IS NOT NULL AND @KeyWhere &lt;&gt; '')<br />
SELECT @sql = @sql + ' AND (a.address LIKE ' + quotename('%' + @KeyWhere + '%','''') +<br />
' OR (a.zipcode LIKE ' + quotename('%' + @KeyWhere + '%','''') +<br />
' OR a.county LIKE ' + quotename('%' + @KeyWhere + '%','''') + '))'<br />
<br />
<br />
--PRINT @sql<br />
<br />
<br />
CREATE TABLE #Result<br />
(<br />
RowNumber int,<br />
[Count] int,<br />
id int,<br />
companyName varchar(150),<br />
orgnumber varchar(20),<br />
address varchar(150),<br />
zipcode varchar(5),<br />
county varchar(20),<br />
phone varchar(20),<br />
activity varchar(100)<br />
<br />
)<br />
INSERT INTO #Result(rownumber, [count], id, companyname, orgnumber, address, zipcode, county, phone, activity)<br />
EXEC sp_executeSQL @sql<br />
<br />
<br />
SELECT * From #Result WHERE RowNumber Between @RowStart and @RowEND<br />
DROP Table #Result<br />
END<br />
END</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>n3tx</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173352</guid>
		</item>
		<item>
			<title>search stored procedurre</title>
			<link>http://forums.devx.com/showthread.php?t=173345&amp;goto=newpost</link>
			<pubDate>Mon, 09 Nov 2009 23:53:24 GMT</pubDate>
			<description><![CDATA[Hello, I am having some problems with a search query.
The problem I am having is that I get duplicate values when I am joining two tables.
Everything worked fine until I joined a second table (Addresses)

Table Companies (ID (unique), CompanyName, Orgnumber ...)
Table Addresses (Company_ID (not unique), Address .. )
-- table can have more than one address with the same Company_ID


Here is my sp:
 
ALTER PROCEDURE [dbo].[sp_GetCompaniesByKeywords] 
@KeyWhat varchar(150) = NULL, -- what to search for
@KeyWhere varchar(150) = NULL, -- where to search
@PageSize int = NULL, -- page size
@PageNumber int = NULL -- current page 



AS
BEGIN 
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE @RowStart int
DECLARE @RowEND int


IF (@PageNumber > 0)
BEGIN
IF (@PageNumber <=1)
SET @RowEND = @RowStart + @PageSize +1

SET @PageNumber = @PageNumber -1
SET @RowStart = @PageSize * @PageNumber+1
SET @RowEND = @RowStart + @PageSize - 1;

DECLARE @sql nvarchar(4000)
SELECT @sql = 
'Select DISTINCT ROW_NUMBER() OVER (ORDER BY C.[Name]) AS RowNumber, COUNT(*) OVER() AS Count, 
c.ID, C.[Name] AS CompanyName, C.Orgnumber AS orgnr, cat.Name AS Genre
FROM Companies as C
JOIN Categories AS cat ON cat.ID = c.Genre_ID
JOIN Addresses AS a ON a.CompanyID = C.ID 
WHERE 1=1'

IF (@KeyWhat IS NOT NULL AND @KeyWhat <> '')
SELECT @sql = @sql + ' AND C.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') +
' OR cat.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') + 
' OR C.Orgnumber LIKE ' + quotename(@KeyWhat + '%', '''')

IF (@KeyWhere IS NOT NULL AND @KeyWhere <> '')
SELECT @sql = @sql + ' AND a.address LIKE ' + quotename('%' + @KeyWhere + '%','''') +
' OR a.zipcode LIKE ' + quotename('%' + @KeyWhere + '%','''') +
' OR a.county LIKE ' + quotename('%' + @KeyWhere + '%','''') +
' OR a.othertext LIKE ' + quotename('%' + @KeyWhere + '%','''')

--PRINT @sql


CREATE TABLE #Result
(
RowNumber int,
[Count] int,
id int,
companyName varchar(150),
orgnumber varchar(20),
kategori varchar(100)

)
INSERT INTO #Result(rownumber, [count], id, companyname, orgnumber, kategori)
EXEC sp_executeSQL @sql


SELECT * From #Result WHERE RowNumber Between @RowStart and @RowEND
DROP Table #Result
END
END

// Daniel]]></description>
			<content:encoded><![CDATA[<div>Hello, I am having some problems with a search query.<br />
The problem I am having is that I get duplicate values when I am joining two tables.<br />
Everything worked fine until I joined a second table (Addresses)<br />
<br />
Table Companies (ID (unique), CompanyName, Orgnumber ...)<br />
Table Addresses (Company_ID (not unique), Address .. )<br />
-- table can have more than one address with the same Company_ID<br />
<br />
<br />
Here is my sp:<br />
 <br />
ALTER PROCEDURE [dbo].[sp_GetCompaniesByKeywords] <br />
@KeyWhat varchar(150) = NULL, -- what to search for<br />
@KeyWhere varchar(150) = NULL, -- where to search<br />
@PageSize int = NULL, -- page size<br />
@PageNumber int = NULL -- current page <br />
<br />
<br />
<br />
AS<br />
BEGIN <br />
-- SET NOCOUNT ON added to prevent extra result sets from<br />
-- interfering with SELECT statements.<br />
SET NOCOUNT ON;<br />
<br />
DECLARE @RowStart int<br />
DECLARE @RowEND int<br />
<br />
<br />
IF (@PageNumber &gt; 0)<br />
BEGIN<br />
IF (@PageNumber &lt;=1)<br />
SET @RowEND = @RowStart + @PageSize +1<br />
<br />
SET @PageNumber = @PageNumber -1<br />
SET @RowStart = @PageSize * @PageNumber+1<br />
SET @RowEND = @RowStart + @PageSize - 1;<br />
<br />
DECLARE @sql nvarchar(4000)<br />
SELECT @sql = <br />
'Select DISTINCT ROW_NUMBER() OVER (ORDER BY C.[Name]) AS RowNumber, COUNT(*) OVER() AS Count, <br />
c.ID, C.[Name] AS CompanyName, C.Orgnumber AS orgnr, cat.Name AS Genre<br />
FROM Companies as C<br />
JOIN Categories AS cat ON cat.ID = c.Genre_ID<br />
JOIN Addresses AS a ON a.CompanyID = C.ID <br />
WHERE 1=1'<br />
<br />
IF (@KeyWhat IS NOT NULL AND @KeyWhat &lt;&gt; '')<br />
SELECT @sql = @sql + ' AND C.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') +<br />
' OR cat.[Name] LIKE ' + quotename('%' + @KeyWhat + '%', '''') + <br />
' OR C.Orgnumber LIKE ' + quotename(@KeyWhat + '%', '''')<br />
<br />
IF (@KeyWhere IS NOT NULL AND @KeyWhere &lt;&gt; '')<br />
SELECT @sql = @sql + ' AND a.address LIKE ' + quotename('%' + @KeyWhere + '%','''') +<br />
' OR a.zipcode LIKE ' + quotename('%' + @KeyWhere + '%','''') +<br />
' OR a.county LIKE ' + quotename('%' + @KeyWhere + '%','''') +<br />
' OR a.othertext LIKE ' + quotename('%' + @KeyWhere + '%','''')<br />
<br />
--PRINT @sql<br />
<br />
<br />
CREATE TABLE #Result<br />
(<br />
RowNumber int,<br />
[Count] int,<br />
id int,<br />
companyName varchar(150),<br />
orgnumber varchar(20),<br />
kategori varchar(100)<br />
<br />
)<br />
INSERT INTO #Result(rownumber, [count], id, companyname, orgnumber, kategori)<br />
EXEC sp_executeSQL @sql<br />
<br />
<br />
SELECT * From #Result WHERE RowNumber Between @RowStart and @RowEND<br />
DROP Table #Result<br />
END<br />
END<br />
<br />
// Daniel</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>n3tx</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173345</guid>
		</item>
		<item>
			<title>pl/sql: dynamic record type?</title>
			<link>http://forums.devx.com/showthread.php?t=173338&amp;goto=newpost</link>
			<pubDate>Mon, 09 Nov 2009 14:31:38 GMT</pubDate>
			<description><![CDATA[I am new to writing PL/SQL (usually have DBA to do this) and have tried googling how to do this, but think I am not searching with the right terminology. (Please pardon me if I don't get the terminology right here either!)  Would extremely appreciate any tips/references on this, as I've pored thru several online docs and haven't found what I need yet.

What the pl/sql needs to do:
1. select multiple columns from table A (master table), which will return only 1 row
2. select 1 column from table B (a one-to-many table), which will return N rows
3. return the data as if it were all one row, with the data from step 2 appearing to be columnar, i.e. COL_1, COL_2, ..., COL_N.

So the pl/sql would need to create N # of columns for the return record type, 1 column for each row returned in step 2.

Specifics: There is a document table which has a 1-many table containing the CC's for that document. Only one row will ever be returned from the master doc table, and 0-n rows from the CC table. There could be no CC's for the doc, or there could be any number. I need to be able to return all the columns from the document table PLUS the CC's as if they were all one row in a table.

So example of a return row might be a doc with n # of cc's

DOC_ID | DOC_TYPE | DOC_OWNER | <etc> | CC_1 | CC_2 | ... | CC_n

or a doc with all its fields and no cc's

DOC_ID | DOC_TYPE | DOC_OWNER | <etc>


I hope this makes sense.  Thanks to any one who can help out the java code slinger. :)]]></description>
			<content:encoded><![CDATA[<div>I am new to writing PL/SQL (usually have DBA to do this) and have tried googling how to do this, but think I am not searching with the right terminology. (Please pardon me if I don't get the terminology right here either!)  Would extremely appreciate any tips/references on this, as I've pored thru several online docs and haven't found what I need yet.<br />
<br />
What the pl/sql needs to do:<br />
1. select multiple columns from table A (master table), which will return only 1 row<br />
2. select 1 column from table B (a one-to-many table), which will return N rows<br />
3. return the data as if it were all one row, with the data from step 2 appearing to be columnar, i.e. COL_1, COL_2, ..., COL_N.<br />
<br />
So the pl/sql would need to create N # of columns for the return record type, 1 column for each row returned in step 2.<br />
<br />
Specifics: There is a document table which has a 1-many table containing the CC's for that document. Only one row will ever be returned from the master doc table, and 0-n rows from the CC table. There could be no CC's for the doc, or there could be any number. I need to be able to return all the columns from the document table PLUS the CC's as if they were all one row in a table.<br />
<br />
So example of a return row might be a doc with n # of cc's<br />
<br />
DOC_ID | DOC_TYPE | DOC_OWNER | &lt;etc&gt; | CC_1 | CC_2 | ... | CC_n<br />
<br />
or a doc with all its fields and no cc's<br />
<br />
DOC_ID | DOC_TYPE | DOC_OWNER | &lt;etc&gt;<br />
<br />
<br />
I hope this makes sense.  Thanks to any one who can help out the java code slinger. :)</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>astehman</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173338</guid>
		</item>
		<item>
			<title>Sub query question</title>
			<link>http://forums.devx.com/showthread.php?t=173316&amp;goto=newpost</link>
			<pubDate>Thu, 05 Nov 2009 15:48:07 GMT</pubDate>
			<description><![CDATA[I have am trying to write a subqueriy.I have three columns, Column A has a code like break, lunch the other two columns have a date and time. I am trying to do a sub query so I can group by column A times and count how many. Then do the same with column 2 in the same query. I can do it in seperate querys but not in a sub query or is thier an eaiers way here is my code. 
Code:
---------
SELECT Count(nettalley.STATE_CODE_1), Nettalley.STATE_CODE_1
FROM Nettalley
WHERE FormatDateTime([nettalley.STATE_TIME_1],4)="00:00"
GROUP BY Nettalley.STATE_CODE_1;
---------
]]></description>
			<content:encoded><![CDATA[<div>I have am trying to write a subqueriy.I have three columns, Column A has a code like break, lunch the other two columns have a date and time. I am trying to do a sub query so I can group by column A times and count how many. Then do the same with column 2 in the same query. I can do it in seperate querys but not in a sub query or is thier an eaiers way here is my code. <div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">SELECT Count(nettalley.STATE_CODE_1), Nettalley.STATE_CODE_1<br />
FROM Nettalley<br />
WHERE FormatDateTime([nettalley.STATE_TIME_1],4)=&quot;00:00&quot;<br />
GROUP BY Nettalley.STATE_CODE_1;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>landslide</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173316</guid>
		</item>
		<item>
			<title>Convert Record Set to View - SQL Server 2005</title>
			<link>http://forums.devx.com/showthread.php?t=173308&amp;goto=newpost</link>
			<pubDate>Wed, 04 Nov 2009 20:42:07 GMT</pubDate>
			<description><![CDATA[I'm hoping someone can point me to the right direction for this.  I want to be able to convert my existing query which returns multiple records into a view that would look sort of like a spreadsheet.

My query that returns something like this:

1     Number_of_Bolts     11
2     Number_of_Nails     325
3     Number_of_Pins      1355

The query itself is:

select question_id, question_name, question_value
from question_data d
inner join question_dictionary i
on d.question_id = i.question_id
where master_id = '2111'

Given this, how do I get it into a format where all the records are on the same row spreadsheet style and the key identifier like Number_of_Bolts is a cell header with 11 as the value underneath it?  I want this be a view in SQL Server.

Thanks for any hints you all can provide.]]></description>
			<content:encoded><![CDATA[<div>I'm hoping someone can point me to the right direction for this.  I want to be able to convert my existing query which returns multiple records into a view that would look sort of like a spreadsheet.<br />
<br />
My query that returns something like this:<br />
<br />
1     Number_of_Bolts     11<br />
2     Number_of_Nails     325<br />
3     Number_of_Pins      1355<br />
<br />
The query itself is:<br />
<br />
select question_id, question_name, question_value<br />
from question_data d<br />
inner join question_dictionary i<br />
on d.question_id = i.question_id<br />
where master_id = '2111'<br />
<br />
Given this, how do I get it into a format where all the records are on the same row spreadsheet style and the key identifier like Number_of_Bolts is a cell header with 11 as the value underneath it?  I want this be a view in SQL Server.<br />
<br />
Thanks for any hints you all can provide.</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>stoneheart</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173308</guid>
		</item>
		<item>
			<title>Stored Procedures Help please</title>
			<link>http://forums.devx.com/showthread.php?t=173279&amp;goto=newpost</link>
			<pubDate>Sun, 01 Nov 2009 06:24:17 GMT</pubDate>
			<description>I have made stored procedures in Oracle...but need to export them to mysql. I have searched on google but cant figure out the syntax.

Here is the oracle procedure:


create or replace procedure delgroup
(g_id in number)

is

begin

DELETE FROM grouptable WHERE GROUP_ID=g_id;

commit;
end;


I jus basically want to delete the group from the group table..depending on which group id (the arguement) the user types in.

How would i do this exact same procedure in mysql?

Please some assistance guys :)</description>
			<content:encoded><![CDATA[<div>I have made stored procedures in Oracle...but need to export them to mysql. I have searched on google but cant figure out the syntax.<br />
<br />
Here is the oracle procedure:<br />
<br />
<br />
create or replace procedure delgroup<br />
(g_id in number)<br />
<br />
is<br />
<br />
begin<br />
<br />
DELETE FROM grouptable WHERE GROUP_ID=g_id;<br />
<br />
commit;<br />
end;<br />
<br />
<br />
I jus basically want to delete the group from the group table..depending on which group id (the arguement) the user types in.<br />
<br />
How would i do this exact same procedure in mysql?<br />
<br />
Please some assistance guys :)</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>badmanmc</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173279</guid>
		</item>
		<item>
			<title>Relationship to Entity Sets</title>
			<link>http://forums.devx.com/showthread.php?t=173264&amp;goto=newpost</link>
			<pubDate>Fri, 30 Oct 2009 02:40:44 GMT</pubDate>
			<description>Hello,

I am working on creating a relationship schema from Access for class.
I was wondering if I should have a link from each and every entity set to the others? Our teacher is allowing one to many and one to one but not many to many. It is a video store database project for class. 

Thanks in advance for the help.</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I am working on creating a relationship schema from Access for class.<br />
I was wondering if I should have a link from each and every entity set to the others? Our teacher is allowing one to many and one to one but not many to many. It is a video store database project for class. <br />
<br />
Thanks in advance for the help.</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>supernix</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173264</guid>
		</item>
		<item>
			<title>ORacle...</title>
			<link>http://forums.devx.com/showthread.php?t=173255&amp;goto=newpost</link>
			<pubDate>Thu, 29 Oct 2009 01:23:14 GMT</pubDate>
			<description>Is it used for buisness only?</description>
			<content:encoded><![CDATA[<div>Is it used for buisness only?</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>unenforcibility</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173255</guid>
		</item>
		<item>
			<title>Database Design Help</title>
			<link>http://forums.devx.com/showthread.php?t=173240&amp;goto=newpost</link>
			<pubDate>Mon, 26 Oct 2009 21:33:14 GMT</pubDate>
			<description><![CDATA[First of all, hi to everyone and thanks in advance for any help!!! :)

problem is this - I'm creating a database/front end for a friend who runs his own computer business. He needs to store customer details as well as job details, ranging from repairs, data recovery, website design and so on. any database work i've done before has had one product or "job", so would each "job" here be stored in its own separate table, linked by another orders table 

eg a customer books a data recovery job, all details of the job are stored in tblDataRecoveryJobs

tblCustomerDetails  --->   tblJobs           --->   tblDataRecoveryJobs
CustID                           JobID                      JobTypeID
                                    CustID
                                    JobTypeID

at first I had one giant table for jobs, with details of all types jobs being stored in it, although by going through the normalisation process wouldn't the one big table be broken down into the smaller ones anyways?

sorry if it sounds a bit confusing, any help at all is greatly appreciated :)]]></description>
			<content:encoded><![CDATA[<div>First of all, hi to everyone and thanks in advance for any help!!! :)<br />
<br />
problem is this - I'm creating a database/front end for a friend who runs his own computer business. He needs to store customer details as well as job details, ranging from repairs, data recovery, website design and so on. any database work i've done before has had one product or &quot;job&quot;, so would each &quot;job&quot; here be stored in its own separate table, linked by another orders table <br />
<br />
eg a customer books a data recovery job, all details of the job are stored in tblDataRecoveryJobs<br />
<br />
tblCustomerDetails  ---&gt;   tblJobs           ---&gt;   tblDataRecoveryJobs<br />
CustID                           JobID                      JobTypeID<br />
                                    CustID<br />
                                    JobTypeID<br />
<br />
at first I had one giant table for jobs, with details of all types jobs being stored in it, although by going through the normalisation process wouldn't the one big table be broken down into the smaller ones anyways?<br />
<br />
sorry if it sounds a bit confusing, any help at all is greatly appreciated :)</div>

]]></content:encoded>
			<category domain="http://forums.devx.com/forumdisplay.php?f=106">Database</category>
			<dc:creator>SCass2009</dc:creator>
			<guid isPermaLink="true">http://forums.devx.com/showthread.php?t=173240</guid>
		</item>
	</channel>
</rss>
