Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download, /proc/kallsyms format, sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm

Links

XODOX
Impressum

#1: UNION ALL

Posted on 2011-07-17 06:44:01 by ron.piggott

------=_NextPart_000_003F_01CC441A.9F044F40
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


I am trying to setup a cross reference database query for the first =
time. What I am trying to do is have a table with the structure:



CREATE TABLE IF NOT EXISTS =
`frequently_accessed_passages_of_scripture_cross_reference` (
`reference` int(5) NOT NULL AUTO_INCREMENT,
`cross_reference_article_1` int(3) NOT NULL,
`cross_reference_article_2` int(3) NOT NULL,
PRIMARY KEY (`reference`)
) ENGINE=3DMyISAM DEFAULT CHARSET=3Dlatin1 AUTO_INCREMENT=3D1 ;



If the content theme (based on auto_increment values) is listed in =
either cross_reference_article_1 OR cross_reference_article_2 then the =
counter part article will be a result so I may offer an âÂ=9CAlso =
available:âÂ=9D type link on the web page. My attempt at the UNION =
ALL query is below. I am receiving the error âÂ=9CEvery derived =
table must have its own aliasâÂ=9D I am unsure of how to interpret =
this and correct the situation. Thanks for your help. Ron



SELECT cross_reference_article_2 FROM=20

(

SELECT `cross_reference_article_2` FROM =
`frequently_accessed_passages_of_scripture_cross_reference` WHERE =
`cross_reference_article_1` =3D 1

) UNION ALL (

SELECT `cross_reference_article_1` FROM =
`frequently_accessed_passages_of_scripture_cross_reference` WHERE =
`cross_reference_article_2` =3D 1

)

AS cross_reference_view_result


The Verse of the Day
âÂ=9CEncouragement from GodâÂ=99s WordâÂ=9D
http://www.TheVerseOfTheDay.info
------=_NextPart_000_003F_01CC441A.9F044F40--

Report this message

#2: Re: UNION ALL

Posted on 2011-07-18 10:59:35 by Amit Tandon

--0023545bf3381353b904a85439c4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Dear Ron

Try this

===================3D
SELECT `cross_reference_article_2`
FROM `frequently_accessed_passages_of_scripture_cross_reference`
WHERE `cross_reference_article_1` =3D 1
UNION ALL
SELECT `cross_reference_article_1`
FROM `frequently_accessed_passages_of_scripture_cross_reference`
WHERE `cross_reference_article_2` =3D 1
===================3D


I have removed the first line and the last line of your query
============
regds
amit

"The difference between fiction and reality? Fiction has to make sense."


On Sun, Jul 17, 2011 at 10:14 AM, Ron Piggott <
ron.piggott@actsministries.org> wrote:

>
> I am trying to setup a cross reference database query for the first time.
> What I am trying to do is have a table with the structure:
>
>
>
> CREATE TABLE IF NOT EXISTS
> `frequently_accessed_passages_of_scripture_cross_reference` (
> `reference` int(5) NOT NULL AUTO_INCREMENT,
> `cross_reference_article_1` int(3) NOT NULL,
> `cross_reference_article_2` int(3) NOT NULL,
> PRIMARY KEY (`reference`)
> ) ENGINE=3DMyISAM DEFAULT CHARSET=3Dlatin1 AUTO_INCREMENT=3D1 ;
>
>
>
> If the content theme (based on auto_increment values) is listed in either
> cross_reference_article_1 OR cross_reference_article_2 then the counter p=
art
> article will be a result so I may offer an âÂ=9CAlso available:âÂ=
=9D type link on
> the web page. My attempt at the UNION ALL query is below. I am receivin=
g
> the error âÂ=9CEvery derived table must have its own aliasâÂ=9D =
I am unsure of how
> to interpret this and correct the situation. Thanks for your help. Ron
>
>
>
> SELECT cross_reference_article_2 FROM
>
> (
>
> SELECT `cross_reference_article_2` FROM
> `frequently_accessed_passages_of_scripture_cross_reference` WHERE
> `cross_reference_article_1` =3D 1
>
> ) UNION ALL (
>
> SELECT `cross_reference_article_1` FROM
> `frequently_accessed_passages_of_scripture_cross_reference` WHERE
> `cross_reference_article_2` =3D 1
>
> )
>
> AS cross_reference_view_result
>
>
> The Verse of the Day
> âÂ=9CEncouragement from GodâÂ=99s WordâÂ=9D
> http://www.TheVerseOfTheDay.info

--0023545bf3381353b904a85439c4--

Report this message