I know this is a silly question, but Im a newb
I'm trying to get all distinct values across 2 tables using a union...
The idea is to get a count of all unique values in the columnA column without repeats so that I can get a summation of all columns that contain a unique columnA... sounds simple eh?
THis is what I tried (sql server expr...
How would I P/Invoke a C function which returns a union'ed struct?
...
Hi,
My problem is on Oracle, but is probably database independent (?).
I have the following tables:
aa
vid cb
--- --
1 10
2 15
bb
vid cb
--- --
3 25
4 24
*rep
repid vid p
----- --- --
99 1 aa
99 2 aa
99 3 bb
99 4 bb
The column p indicates in which table to get the row....
I'm curious if it's a good idea to use a union when accessing Win32 APIs that return variable length structures, to avoid manually managing the allocated memory.
Consider the following:
void displayServices(std::wostream& log, std::tr1::shared_ptr<void> manager, LPENUM_SERVICE_STATUS currentServiceToDisplay, DWORD number, bool whitelis...
I'm having some problems with the following Query:
SELECT v.idnum
,v.full_name
,convert(varbinary(max),s.signature) as Sig
FROM AppDB.dbo.v_People1 AS v INNER JOIN
OtherDB.dbo.Signatures AS s ON v.idnum = s.idnum
UNION
SELECT v.idnum
, v.full_name
, convert(varbinary(max), s.signatu...
I have a example with me where in which the alignment of a type is guaranteed, union max_align . I am looking for a even simpler example in which union is used practically, to explain my friend.
...
Hi
I'm a little confused about how to specify my grammar member's type. I want to declare prog and decls as ASTNode. I'm gonna use these members for adding to a list or etc. But yacc can't recognize them as an ASTNode and I get type errors.
Here my tIdent,tCharConst,tIntConstant have some types but, how to give ASTNode type to my membe...
I can do this in c++/g++:
struct vec3 {
union {
struct {
float x, y, z;
};
float xyz[3];
};
};
Then,
vec3 v;
assert(&v.xyz[0] == &v.x);
assert(&v.xyz[1] == &v.y);
assert(&v.xyz[2] == &v.z);
will work.
How does one do this in c with gcc? I have
typedef struct {
union {
st...
I have a C++ struct that looks like this:
struct unmanagedstruct
{
int flags;
union
{
int offset[6];
struct
{
float pos[3];
float q[4];
} posedesc;
} u;
};
And I'm trying to Marshal it like so in C#:
[StructLayout(Layou...
Scenario
I need to build a table of data from a list of objects given a specification. In example, I have a list/array of Order objects, and a string specification detailing what the data table should contain e.g "ID;Date;Customer.ID;Customer.Name;Orderlines.Product.ID;Orderlines.Quantity;Orderlines.UnitPrice".
The order class class co...
I have two procedures - two huge sets of selects with several sub-select and unions.
I need to union results from these procedures and I still need them to exists separately.
Something like that:
if @Param = 1 Then
PROCEDURE1
if @Param = 2 THEN
PROCEDURE2
if @Param = 3 Then
PROCEDURE1 union PROCEDURE2
I read that it's i...
Hi all
How to do UNION query with codeigniter's active record?
...
This is a SQL design question. First, the setup. I have three tables:
A, which is automatically populated based on a query against a linked server. The data in this table cannot be changed;
B, which has just a dozen or so rows, containing the names for collections of A's;
AtoB, which is the mapping table by which A's are organized into...
I can get all the tables containing column 'hostname' using:
select select table_name from information_schema.columns
where column_name='hostname';
If I knew the names of all the tables I could use a union like:
SELECT * FROM ((SELECT hostname FROM table1)
UNION (SELECT hostname FROM table2)
...
UNION (SELECT hostname ...
On my AVR I have an array of chars that hold color intensity information in the form of {R,G,B,x,R,G,B,x,...} (x being an unused byte). Is there any simple way to write a long int (32-bits) to char myArray[4*LIGHTS] so I can write a 0x00BBGGRR number easily?
My typecasting is rough, and I'm not sure how to write it. I'm guessing jus...
Hi guys,
The following is my query
Select vehicleID from trip where (StartingDate between ''+ convert(varchar(10), @StartDate,111) +'' and ''+ convert(varchar(10), @EndDate,111)+'')
or (enddate between ''+ convert(varchar(10), @StartDate,111) +'' and ''+ convert(varchar(10), @EndDate,111)+'')
or(StartingDate <= @StartDate and enddate...
Edit 1 (clarification): Thank you for the answers so far! The response is gratifying.
I want to clarify the question a little because based on the answers I think I did not describe one aspect of the problem correctly (and I'm sure that's my fault as I was having a difficult time defining it even for myself).
Here's the rub: The result s...
For example, say we have a union
typedef union {
unsigned long U32;
float f;
}U_U32_F;
When a variable of this union type is declared, is there a way to set an initial value?
U_U32_F u = 0xffffffff; // Does not work...is there a correct syntax for this?
...
Problem: I have a list of names and addresses. Some names (persons) have the same address (street, zip code, town) like others. I want to select all those names with addresses with no more than three occurrences and from the rest the first three names each of a bunch pointing to the same address.
Example:
Albert | Adr1
Berta | Adr1
Cesa...
I'd like to do a single query on one table without using UNION
Here are the two queries that I need to combine.
SELECT field1, field2, field3 FROM table1 WHERE field4 != 'condition1' AND feild3 >= 'condition2' ORDER BY field3 ASC LIMIT 20;
SELECT field1, field2, field3 FROM table1 WHERE field4 != 'condition1' AND feild3 < 'condition2' ...