Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Dakha
Feb 18, 2002

Fun Shoe
Here's a pretty general question, I'm extracting data from a system, and there's only a few places where we have a known key to use, and often it's a really, really big number of keys. Along the lines of:

SELECT *
FROM materials
WHERE matnr IN ( set of 50-100000 material numbers).

These sorts of queries often fail to execute, as the input parameter files are just too large. When we split them up and run the union of queries, it takes much, much longer.

Is there some simple way we can rework things so that the extraction can be done in a reasonable amount of time? Some of the more complicated queries are taking FAR too long to run

Adbot
ADBOT LOVES YOU

Dakha
Feb 18, 2002

Fun Shoe
Cheers guys. I made a table, and it makes all the difference :cool:

Dakha
Feb 18, 2002

Fun Shoe
I'm extracting data from an oracle database using SQL+. One of the tables I need to get has several columns such as '/AB/CDE' and '/AB/CDF' etc.

However, when I attempt to execute:

SELECT KONP./AB/CDE, KONP./AB/CDF FROM KONP
WHERE....

it doesn't recognise the columns. Nor does:

SELECT /AB/CDE, /AB/CDF FROM KONP
WHERE....

Is this an escape character thing? I thought the escape character was backslash not slash. What should I do so that SQL+ can get the columns I need?

Dakha
Feb 18, 2002

Fun Shoe

m5 posted:

Square brackets maybe? I'm guessing because I'm not sure what you're saying - are those slashes supposed to mean something or are they part of the column names and not otherwise interesting? (If so then wtf)

So maybe
code:
SELECT [/AB/CDE], [/AB/CDF] from KONP WHERE ...

Yeah, they are just really stupidly named columns. The columns are in several tables im joining, so do I use:

KONP.[/AB/CDE] or [KONP./AB/CDE] ?

Dakha
Feb 18, 2002

Fun Shoe
This is probably really easy to fix, but I'm trying select a list of material numbers, and their corresponding text descriptions. However, the table with the text descriptions has several entries for each material number, for different languages. I want to get the german description, unless it doesn't exist, in which case I want the english descriptions.

I'm currently using:

SELECT material_number, material_text
FROM materials
INNER JOIN mat_desc
ON materials.material_number = mat_desc.material_number
GROUP BY material_number, material_text;

This only works because language = 'DE' is ordered first by default, and 'EN' is ordered second. This seems pretty dodgy though. Is there a proper way of doing this?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply