473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to select top 1 from table1 where table2 contains a list of values to select on

Table 1 = list of client transactions (many per client)
Table 2 = list of client numbers to use as selection critera (1 each)
Table 3 = client table containing the status of client; i only want clients with a status of 'AC'

I only want the most recent transaction based on a transaction date (top 1 ?)

I could eliminate table 3 references by performing that step in the reporting process.

I've spent hours trying to figure this crazy thing out.
Help would be glorious
thanks,
John
Sep 19 '09 #1
1 2032
ck9663
2,878 Expert 2GB
Could you post some sample data?

-- CK
Sep 21 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Craig Stadler | last post by:
Can someone help with query syntax regarding IN/EXISTS.. I'm trying to do this: insert into table2 (field1) select field1 from table1 where field1 not in (select field1 from table2) delete...
3
by: Jay K | last post by:
Hi, I have multiple queries like this: SELECT col1, col2, col3, col4 FROM table1, table2 where table1.col1 = table2.col1 and table1.col2 = 1 ORDER BY col3 desc LIMIT 5 and
2
by: Eric | last post by:
please help to select these rows from these tables my tables are table1 table1Id groupId table2id price 1 1 1 10 2 1 3 1000 3 1 ...
6
by: DC Gringo | last post by:
I have a series of select queries that use the nesting method but are creating such a huge query that the server can't handle it. The IN section in some cases are so large that I can't even...
3
by: Alex | last post by:
Hi, I need to form a query where i can add some columns based on the result. Table A ColA, ColB ---------- 1 A 2 B
1
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here...
0
by: k4 | last post by:
Here is my problem: I have two tables. Table1 contains two fields. Field1 contains names of job types (Accountant,Doctor,etc.) Field2 contains the number of cases to select from Table2 for each...
17
by: bobo420 | last post by:
Hi! I have 4 tables (table1, table2, table3, table 4) I need to do select * from all four table and get them sorted all the tables have field named id, so I figured that's the field I should...
2
by: Dreea | last post by:
hello I have to mysql identical tables that contain different data. I would like to select all values from table1 and all values from table2 using the same query if i use SELECT table1.*, table2.*...
10
by: Jeff Kish | last post by:
Can anyone tell me how to do this in sql server? I am currently doing this query in oracle: select table1.col1,table1.col2,table2.col3,table4.col4 where table1.col1 = table2.col3 and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.