we have multiple location inv what am i joining th...
# suiteql
s
we have multiple location inv what am i joining the item table with to get the inv info
s
Which info? Location qty available?
s
Location qty available yes
s
inventoryItemLocations
s
Copy code
inventoryItemLocations.itemid  = item.id
??
s
inventoryItemLocations.item = item.id
s
not sure why it is not working
Copy code
SELECT item.*
FROM item 
INNER JOIN inventoryItemLocations ON  item
inventoryItemLocations.item = item.id
WHERE item.ROWNUM = 1
s
You have an extra word in there (3rd line, 'item' shouldn't exist), and also rownum isn't a field in the item table. The way this is written, it will return all the item fields as many times as you have locations. So if you have 10 locations you are going to see the same item, 10 times. Is that what you're aiming for?
s
im trying to get the inv from one location for a list of items
s
OK you'll want something that filters to the specific location. Get the internal ID of the location.
Copy code
SELECT 
	Item.displayname,
	inventoryItemLocations.quantityavailable
FROM
	Item
	INNER JOIN inventoryItemLocations ON Item.ID = inventoryItemLocations.item AND inventoryItemLocations.location = 1
s
how can I join the assembly items which is called a member item /component
s
Tim Dietrich has a blog article on that. https://timdietrich.me/blog/netsuite-suiteql-assembly-items/
a
Tims solution works if you aren't using advanced bills of materials.
s
how can i add a colmun that is division of two
a
columnname  / 2
?
s
i mean columnnameA/columnnameB
s
Just like that. columnnameA/columnnameB
s
Copy code
qty/MemberItemQty
Copy code
Search error occurred: Invalid or unsupported search
i see it only works on the columname no alias