Marco: Do we look reasonable to you? Mal: Well. Looks can be deceiving. Jayne: Not as deceiving as a low down dirty... deceiver.

'Out Of Gas'


Buffistechnology 3: "Press Some Buttons, See What Happens."

Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!


§ ita § - May 04, 2007 8:28:55 am PDT #1480 of 25496
Well not canonically, no, but this is transformative fiction.

Null values would screw up SELECT colA, colB, * FROM TableA WHERE colA=colB too though, no?

Doesn't look like there are any values in colB that are null. Now, I did try switching the order in the expression of colA and colB (frustrated and bored) and that didn't fix it either.

Grr.

Funnily enough, a coworker told me that colA==colB, and I knew it wasn't because I'm working on reconciling data. So when the query agreed with him, I got paranoid.

When I couldn't flip the one query and get the correct results, I began to wonder if he was using Jedi mind powers or something to mess with me.


§ ita § - May 04, 2007 8:34:33 am PDT #1481 of 25496
Well not canonically, no, but this is transformative fiction.

::returns from quick test::

Ayup. NULL isn't equal to NULL either. And having NULL in either colA or colB is making it night impossible to return that row with a criterion that compares the two.


Jon B. - May 04, 2007 8:35:39 am PDT #1482 of 25496
A turkey in every toilet -- only in America!

ita - have you tried using design view to build a simple query? Your sql should work, but using design view might help.


hippocampus - May 04, 2007 8:38:14 am PDT #1483 of 25496
not your mom's socks.

MySQL doesn't work that way...

(hence my confusion - sorry ita!)

I have really old Access skills ...


Gudanov - May 04, 2007 8:43:11 am PDT #1484 of 25496
Coding and Sleeping

SELECT colA, colB, * FROM TableA WHERE ISNULL(colA=colB)


§ ita § - May 04, 2007 8:44:13 am PDT #1485 of 25496
Well not canonically, no, but this is transformative fiction.

have you tried using design view to build a simple query? Your sql should work, but using design view might help.

I started it in Design view, and then switched to SQL view to enter my specifics. Then, when it was weird, switched back to Design view where everything looked theoretically normal. I'm not sure of any other way to enter it into Design view than like:

Field:TableA.*colAcolB Table:TableATableATableA Sort: Show:YYY Criteria:<>[colB]

(and it'll be a miracle if that table comes out right...)


Gudanov - May 04, 2007 8:44:59 am PDT #1486 of 25496
Coding and Sleeping

The Query Designer will get it wrong.


Jon B. - May 04, 2007 8:47:54 am PDT #1487 of 25496
A turkey in every toilet -- only in America!

That design should work, but you might also try creating a fourth field that's an expression, like expr1: [colA] = [colB], and then have the criteria in the field be equal to false.


Barkley - May 04, 2007 8:48:54 am PDT #1488 of 25496

If you have nulls in either column, this is the query in Oracle: select colA, colB, r.* from table r where nvl(colA,'NOTMATCHA') != nvl(colB,'NOTMATCHB')

I think mysql's version of the nvl function is ifnull, but I don't have mysql here to test: select colA, colB, * from table where ifnull(colA,'NOTMATCHA') != ifnull(colB,'NOTMATCHB')


Gudanov - May 04, 2007 8:49:19 am PDT #1489 of 25496
Coding and Sleeping

expr1: [colA] = [colB], and then have the criteria in the field be equal to false.

It will evaluate to NULL instead of false because Access is whacked out.